System and method of measuring distances related to an object

ABSTRACT

A system and method for measuring distances related to a target object depicted in an image and the construction and delivery of supplemental window materials for fenestration. A digital image is obtained that contains a target object dimension and a reference object dimension in the same plane. The digital image may contain a target object dimension identified by an ancillary object and a reference object dimension in different planes. Fiducial patterns on the reference and optional ancillary objects are used that are recognized by an image analysis algorithm. Information regarding a target object and its immediate surroundings is provided to an automated or semi-automated measurement process, design and manufacturing system such that customized parts are provided to end users. The digital image contains a reference object having a reference dimension and calculating a constraint dimension from the digital image based on a reference dimension. The custom part is then designed and manufactured based on a calculated constraint dimension.

REFERENCE TO PRIORITY APPLICATION

This application is a continuation-in-part of U.S. application Ser. No. 13/735,449, filed Jan. 7, 2013, entitled “System and Method of Measuring Distances Related to an Object,” incorporated herein by reference in its entirety.

FIELD OF THE INVENTION

The present invention relates generally to image processing and in particular to a system and method for measuring the distances related to a target object depicted in an image and the construction and delivery of supplemental window materials for fenestration.

BACKGROUND OF THE INVENTION

In recognition of the ecological and cost impact of fossil fuels and other conventional energy sources, significant effort has been expended in developing methods for more efficient use of such energy sources. An important area of energy use for which greater energy efficiency is needed is the heating and cooling of spaces in which human activity is desired. Many approaches have been developed to decrease the amount heat transfer through the shell of such spaces. One of the most active and important areas of activity is the transfer of energy through fenestration where the activity has included use of window films or inserts, increasing the number of window glazings per opening and window treatments such as drapes, blinds, etc. While these approaches have shown considerable improvement in building energy efficiency, significant problems prevent more widespread and effective utilization.

Several problems exist in the approaches to minimizing heat transfer through fenestration. In particular for existing windows, it is desirable to maintain the optical transparency of the window, operation of the window treatments (e.g., blinds) and windows and the aesthetics of the interior view of the window while providing thermal insulation. Furthermore, reuse of the insulating materials is highly desirable so that new materials do not need to be purchased each season. When adding supplemental window elements such as films, film support elements and window treatments, ease of installation (including measurement and fabrication), reusability and storage and aesthetics during and after use are very important while obtaining the thermal and radiation insulation desired. With window films intended for creating an additional “dead air” space adjacent to the window as well as window treatments, accurate measurement of the film dimensions is necessary, often requiring the assistance of a professional with the associated added cost and time. Other window films, such as tints, infrared or ultraviolet reflective or absorbing films, or low-e films, adhere directly to the windowpane and have similar issues. Additionally, with the wide acceptance of mobile device applications that enable window treatment aesthetic choices to be made using images, it is desirable to add image based measurement capability to such applications.

SUMMARY OF THE INVENTION

The present invention is a system and method for measuring the distances related to an object depicted in an image and the construction and delivery of supplemental window materials for fenestration. One embodiment of the present invention provides a method of photogrammetric measurement in which a digital image is obtained that contains a target object dimension and a reference object dimension in substantially the same plane or line.

Another embodiment of the present invention provides a method of photogrammetric measurement in which a digital image is obtained that contains a target object dimension identified by an ancillary object and a reference object dimension in different planes. Automation of embodiments of the present invention is facilitated by using fiducial patterns on reference and optional ancillary objects that are recognized by an image analysis algorithm.

A further embodiment of the present invention provides use of digital image processing thresholding methods with images of fenestration in which the background area of the transparent portion of the fenestration has contrast relative to the fenestration components visible in the image adjacent to the transparent portion of the fenestration. In each embodiment, a digital image undergoes digital image processing to provide improved measurement capability.

In embodiments of the present invention, information regarding a target object, such as fenestration, and its immediate surroundings is provided to an automated or semi-automated measurement process, design and manufacturing system such that customized parts are provided to end users. In one method of the present invention, a digital image is obtained that contains at least a portion of an observable constraint dimension to which a customized part is to conform wherein the digital image contains a reference object having a reference dimension and calculating a constraint dimension from the digital image based on a reference dimension. The custom part is then designed and manufactured based on a calculated constraint dimension.

Another embodiment of the present invention provides an improved information gathering method and data extraction where the measurements used to design custom parts that meet the needs of the fenestration and user are obtained from photographic information, e.g., digital images. The customized parts may include materials that provide for thermal insulation, emissivity control, tinting, window treatments or mounting support for such materials.

The advantages of the system and method of measuring distances associated with fixed buildings, mobile homes, travel trailers and other habitations include the following.

The ease of specification of the supplemental element is improved for the end user. The involvement of the end user in specifying, fabricating and installing the supplemental element is minimized. The end user's involvement is relatively easy to perform so the end user does not require a professional and requires minimal time commitment. Further, when automated measurements are employed using image processing and metadata, such measurements may be easily associated and maintained with the specific fenestration location.

The accuracy of the automated measurement is relatively high. This relates to ease of use and removing the potential for end user error from the process. Utilization of easily obtained and ubiquitous objects, apparatus and materials in an automated process allows the process to provide accurate measurement of object dimensions. This is important for end user satisfaction and minimizing return of product. In addition, measurement accuracy allows for reduced cost and waste as well as ease of use.

The invention includes a capability for visual confirmation of designed parts and remote or customized support of end user installation. This relates to the ease with which a design may be confirmed by the end user prior to fabrication. Since the end user and service provider or fabricator may view the same image easily, any necessary correction to the design prior to fabrication is facilitated by the use of a digital image. In addition, the digital image may be used as part of remote installation support or customized media that may be used by the end user for each installation. This enhances end user satisfaction with the delivered product and minimizes waste of time and materials due to design error.

There is thus provided in accordance with the invention, a method of estimating at least one dimension of a target object within a digital image which includes a reference object having a fiducial pattern printed thereon placed substantially in a plane of the target object, the method comprising obtaining a digital image containing the target object and the reference object, locating the reference object in the digital image utilizing the fiducial pattern, calculating a pixel scale factor based on both measured and known dimensions of the reference object, locating the target object in the digital image and calculating the at least one dimension of the target object based on the pixel scale factor.

There is also provided in accordance with the invention, a method of estimating at least one dimension of a window within a digital image which includes a reference object having a fiducial pattern printed thereon placed substantially in a plane of the window, the method comprising obtaining a digital image containing the window and the reference object, applying a perspective transform to the digital image, locating the reference object in the digital image utilizing the fiducial pattern, calculating a pixel scale factor based on both measured and known dimensions of the reference object, locating the window in the digital image and calculating the at least one dimension of the window based on the pixel scale factor.

There is further provided in accordance with the invention, a method of estimating at least one dimension of a target object within a digital image which includes a reference object having a reference fiducial pattern printed thereon and one or more ancillary objects for aiding in determining the dimensions of the target object and having a respective ancillary fiducial pattern printed thereon, the method comprising obtaining a digital image containing the target object, reference object and one or more ancillary objects, applying a perspective transform to the digital image, locating the reference object in the digital image utilizing the reference fiducial pattern, calculating a reference pixel scale factor based on both measured and known dimensions of the reference object, locating the one or more ancillary objects in the digital image utilizing the respective ancillary fiducial pattern, locating the target object in the digital image and calculating the at least one dimension of the target object utilizing the pixel scale factor and the measurement point.

There is also provided in accordance with the invention, a computer program product for estimating at least one dimension of a target object within a digital image which includes a reference object having a fiducial pattern printed thereon placed substantially in a plane of the target object, the computer program product comprising a non-transitory, tangible computer usable storage medium having computer usable code embodied therewith, the computer usable program code comprising computer usable code configured for obtaining a digital image containing the target object and the reference object, computer usable code configured for locating the reference object in the digital image utilizing the fiducial pattern, computer usable code configured for calculating a pixel scale factor based on both measured and known dimensions of the reference object, computer usable code configured for locating the target object in the digital image and computer usable code configured for calculating the at least one dimension of the target object based on the pixel scale factor.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention is herein described, by way of example only, with reference to the accompanying drawings, wherein:

FIG. 1 is a block diagram illustrating an example computer processing system adapted to implement the measurement and image processing mechanism of the present invention;

FIG. 2 is a high level block diagram illustrating an example tablet/mobile device incorporating the measurement and image processing mechanism of the present invention;

FIG. 3 is a block diagram illustrating an example room in which an end user obtains a digital image of sample window;

FIG. 4 is a block diagram illustrating an example network showing the data flow between fabricator, designer, service provider and end user;

FIG. 5 is a diagram illustrating a sample window with reference object and one or more ancillary objects;

FIG. 6 is a diagram illustrating the volume of space an end user must be in when acquiring the digital image of the window;

FIGS. 7A and 7B are flow diagrams illustrating an example overall workflow between the end user and service provider;

FIGS. 8A and 8B are flow diagrams illustrating an example triage resolution imaging method;

FIG. 9 is a flow diagram illustrating an example method for determining reference object dimensions;

FIG. 10 is a flow diagram illustrating a method for finding an ancillary object;

FIG. 11 is a flow diagram illustrating a method for finding a collection of ancillary objects;

FIG. 12 is a flow diagram illustrating a method for finding window panes;

FIGS. 13A and 13B are flow diagrams illustrating a method for determining a perspective transform;

FIG. 14 is an illustration of destination points of a perspective transform;

FIG. 15 is a flow diagram illustrating an example preparation for measurement method;

FIG. 16 is a flow diagram illustrating an example measurement method;

FIG. 17 is a flow diagram illustrating an example method for calculating the target object dimension substantially in the reference object plane;

FIG. 18 is a flow diagram illustrating an example method for calculating the target object dimension offset from the reference object plane;

FIG. 19 is a diagram illustrating orthographic and top views of offset plane measurements; and

FIG. 20 is a diagram illustrating parameters for camera location determination.

DETAILED DESCRIPTION OF THE INVENTION

The present invention provides a system and method for the measurement of distances related to a target object depicted in an image and the construction and delivery of supplemental materials and parts for fenestration. One embodiment of the invention includes a method of photogrammetric measurement in which a digital image is obtained that contains a target object dimension and a reference object dimension in substantially the same plane or line. The digital image then undergoes digital image processing to provide improved measurement capability. In embodiments of the present invention, information regarding a target object, such as fenestration, and its immediate surroundings is provided to an automated or semi-automated measurement process, design and manufacturing system such that customized materials and parts are provided to end users.

In one method of the present invention, a digital image is obtained that contains at least a portion of an observable constraint dimension to which a customized part conforms wherein the digital image contains a reference object having a reference dimension. A constraint dimension is then calculated from the digital image based on a reference dimension. The custom part is then designed and manufactured based on a calculated constraint dimension.

As will be appreciated by one skilled in the art, one or more embodiments of the present invention may be embodied as a system, method, computer program product or any combination thereof. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment (including firmware, resident software, micro-code, etc.) or an embodiment combining software and hardware aspects that may all generally be referred to herein as a “circuit,” “module” or “system.” Furthermore, the present invention may take the form of a computer program product embodied in any tangible medium of expression having computer usable program code embodied in the medium.

The invention or portions thereof may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform particular tasks or implement particular abstract data types. The invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.

Any combination of one or more computer usable or computer readable medium(s) may be utilized. The computer-usable or computer-readable medium may be, for example but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CDROM), optical storage device or a magnetic storage device. Note that the computer-usable or computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted, or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory. In the context of this document, a computer-usable or computer-readable medium may be any medium that can contain or store the program for use by or in connection with the instruction execution system, apparatus, or device.

Computer program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, Swift, C++, C# or the like and conventional procedural programming languages, such as the C programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider).

The present invention is described below with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented or supported by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.

These computer program instructions may also be stored in a computer-readable medium that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable medium produce an article of manufacture including instruction means which implement the function/act specified in the flowchart and/or block diagram block or blocks.

The computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.

The invention is operational with numerous general purpose or special purpose computing system environments or configurations. Examples of well-known computing systems, environments, and/or configurations that may be suitable for use with the invention include, but are not limited to, personal computers, server computers, cloud computing, hand-held or laptop devices, multiprocessor systems, microprocessor, microcontroller or microcomputer based systems, set top boxes, programmable consumer electronics, ASIC or FPGA core, DSP core, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.

A block diagram illustrating an example computer processing system adapted to implement the distance measurement and image processing mechanism of the present invention is shown in FIG. 1. The exemplary computer processing system, generally referenced 10, for implementing the invention comprises a general purpose computing device 11. Computing device 11 comprises central processing unit (CPU) 12, host/PCI/cache bridge 20 and main memory 24.

The CPU 12 comprises one or more general purpose CPU cores 14 and optionally one or more special purpose cores 16 (e.g., DSP core, floating point, etc.). The one or more general purpose cores execute general purpose opcodes while the special purpose cores executes functions specific to their purpose. The CPU 12 is coupled through the CPU local bus 18 to a host/PCI/cache bridge or chipset 20. A second level (i.e. L2) cache memory (not shown) may be coupled to a cache controller in the chipset. For some processors, the external cache may comprise an L1 or first level cache. The bridge or chipset 20 couples to main memory 24 via memory bus 22. The main memory comprises dynamic random access memory (DRAM) or extended data out (EDO) memory, or other types of memory such as ROM, static RAM, flash, and non-volatile static random access memory (NVSRAM), bubble memory, etc.

The computing device 11 also comprises various system components coupled to the CPU via system bus 26 (e.g., PCI). The host/PCI/cache bridge or chipset 20 interfaces to the system bus 26, such as peripheral component interconnect (PCI) bus. The system bus 26 may comprise any of several types of well-known bus structures using any of a variety of bus architectures. Example architectures include Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Enhanced ISA (EISA) bus, Video Electronics Standards Associate (VESA) local bus and Peripheral Component Interconnect (PCI) also known as Mezzanine bus.

Various components connected to the system bus include, but are not limited to, non-volatile memory (e.g., disk based data storage) 28, video/graphics adapter 30 connected to display 32, user input interface (I/F) controller 31 connected to one or more input devices such mouse 34, tablet 35, microphone 36, keyboard 38 and modem 40, network interface controller 42, peripheral interface controller 52 connected to one or more external peripherals such as printer 54 and speakers 56. The network interface controller 42 is coupled to one or more devices, such as data storage 46, remote computer 48 running one or more remote applications 50, via a network 44 which may comprise the Internet cloud, a local area network (LAN), wide area network (WAN), storage area network (SAN), etc. A small computer systems interface (SCSI) adapter (not shown) may also be coupled to the system bus. The SCSI adapter can couple to various SCSI devices such as a CD-ROM drive, tape drive, etc.

The non-volatile memory 28 may include various removable/non-removable, volatile/nonvolatile computer storage media, such as hard disk drives that reads from or writes to non-removable, nonvolatile magnetic media, a magnetic disk drive that reads from or writes to a removable, nonvolatile magnetic disk, an optical disk drive that reads from or writes to a removable, nonvolatile optical disk such as a CD ROM or other optical media. Other removable/non-removable, volatile/nonvolatile computer storage media that can be used in the exemplary operating environment include, but are not limited to, magnetic tape cassettes, flash memory cards, digital versatile disks, digital video tape, solid state RAM, solid state ROM, and the like.

A user may enter commands and information into the computer through input devices connected to the user input interface 31. Examples of input devices include a keyboard and pointing device, mouse, trackball or touch pad. Other input devices may include a microphone, joystick, game pad, satellite dish, scanner, etc.

The computer 11 may operate in a networked environment via connections to one or more remote computers, such as a remote computer 48. The remote computer may comprise a personal computer (PC), server, router, network PC, peer device or other common network node, and typically includes many or all of the elements described supra. Such networking environments are commonplace in offices, enterprise-wide computer networks, intranets and the Internet.

When used in a LAN networking environment, the computer 11 is connected to the LAN 44 via network interface 42. When used in a WAN networking environment, the computer 11 includes a modem 40 or other means for establishing communications over the WAN, such as the Internet. The modem 40, which may be internal or external, is connected to the system bus 26 via user input interface 31, or other appropriate mechanism.

The computing system environment, generally referenced 10, is an example of a suitable computing environment and is not intended to suggest any limitation as to the scope of use or functionality of the invention. Neither should the computing environment be interpreted as having any dependency or requirement relating to any one or combination of components illustrated in the exemplary operating environment.

In one embodiment, the software adapted to implement the system and methods of the present invention can also reside in the cloud. Cloud computing provides computation, software, data access and storage services that do not require end-user knowledge of the physical location and configuration of the system that delivers the services. Cloud computing encompasses any subscription-based or pay-per-use service and typically involves provisioning of dynamically scalable and often virtualized resources. Cloud computing providers deliver applications via the internet, which can be accessed from a web browser, while the business software and data are stored on servers at a remote location.

In another embodiment, software adapted to implement the system and methods of the present invention is adapted to reside on a tangible, non-transitory computer readable medium. Computer readable media can be any available media that can be accessed by the computer and capable of storing for later reading by a computer a computer program implementing the method of this invention. Computer readable media includes both volatile and nonvolatile media, removable and non-removable media. By way of example, and not limitation, computer readable media may comprise computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. Communication media typically embodies computer readable instructions, data structures, program modules or other data such as a magnetic disk within a disk drive unit. The software adapted to implement the system and methods of the present invention may also reside, in whole or in part, in the static or dynamic main memories or in firmware within the processor of the computer system (i.e. within microcontroller, microprocessor or microcomputer internal memory).

Other digital computer system configurations can also be employed to implement the system and methods of the present invention, and to the extent that a particular system configuration is capable of implementing the system and methods of this invention, it is equivalent to the representative digital computer system of FIG. 1 and within the spirit and scope of this invention.

Once they are programmed to perform particular functions pursuant to instructions from program software that implements the system and methods of this invention, such digital computer systems in effect become special purpose computers particular to the method of this invention. The techniques necessary for this are well known to those skilled in the art of computer systems.

It is noted that computer programs implementing the system and methods of this invention will commonly be distributed to users via Internet download or on a distribution medium such as floppy disk, CDROM, DVD, flash memory, portable hard disk drive, etc. From there, they will often be copied to a hard disk or a similar intermediate storage medium. When the programs are to be run, they will be loaded either from their distribution medium or their intermediate storage medium into the execution memory of the computer, configuring the computer to act in accordance with the method of this invention. All these operations are well known to those skilled in the art of computer systems.

The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or by combinations of special purpose hardware and computer instructions.

Tablet/Mobile Device Incorporating the Mechanism for Measuring the Distances Related to a Target Object

A high-level block diagram illustrating an example tablet/mobile device incorporating the distance measuring mechanism of the present invention is shown in FIG. 2. The mobile device is preferably a two-way communication device having voice and/or data communication capabilities. In addition, the device optionally has the capability to communicate with other computer systems via the Internet. Note that the mobile device may comprise any suitable wired or wireless device such as multimedia player, mobile communication device, digital still or video camera, cellular phone, smartphone, iPhone, PDA, PNA, Bluetooth device, tablet computing device such as the iPad or other iOS device, Android device, Surface, Nexus, Google Glass, etc. For illustration purposes only, the device is shown as a mobile device, such as a cellular based telephone, smartphone or superphone. Note that this example is not intended to limit the scope of the mechanism as the invention can be implemented in a wide variety of communication devices. It is further appreciated the mobile device shown is intentionally simplified to illustrate only certain components, as the mobile device may comprise other components and subsystems beyond those shown.

The mobile device, generally referenced 60, comprises one or more processors 62 which may comprise a baseband processor, CPU, microprocessor, DSP, etc., optionally having both analog and digital portions. The mobile device may comprise a plurality of cellular radios 102 and associated antennas 104. Radios for the basic cellular link and any number of other wireless standards and Radio Access Technologies (RATs) may be included. Examples include, but are not limited to, Code Division Multiple Access (CDMA), Personal Communication Services (PCS), Global System for Mobile Communication (GSM)/GPRS/EDGE 3G; WCDMA; WiMAX for providing WiMAX wireless connectivity when within the range of a WiMAX wireless network; Bluetooth for providing Bluetooth wireless connectivity when within the range of a Bluetooth wireless network; WLAN for providing wireless connectivity when in a hot spot or within the range of an ad hoc, infrastructure or mesh based wireless LAN (WLAN) network; near field communications; UWB; GPS receiver for receiving GPS radio signals transmitted from one or more orbiting GPS satellites, FM transceiver provides the user the ability to listen to FM broadcasts as well as the ability to transmit audio over an unused FM station at low power, such as for playback over a car or home stereo system having an FM receiver, digital broadcast television, etc.

The mobile device may also comprise internal volatile storage 64 (e.g., RAM) and persistent storage 68 (e.g., ROM) and flash memory 66. Persistent storage 68 also stores applications executable by processor(s) 62 including the related data files used by those applications to allow device 60 to perform its intended functions. Several optional user-interface devices include trackball/thumbwheel which may comprise a depressible thumbwheel/trackball that is used for navigation, selection of menu choices and confirmation of action, keypad/keyboard such as arranged in QWERTY fashion for entering alphanumeric data and a numeric keypad for entering dialing digits and for other controls and inputs (the keyboard may also contain symbol, function and command keys such as a phone send/end key, a menu key and an escape key), headset 88, earpiece 86 and/or speaker 84, microphone(s) and associated audio codec 82 or other multimedia codecs, vibrator for alerting a user, one or more cameras and related circuitry 110, 112, display(s) 122 and associated display controller 106 and touchscreen control 108. Serial ports include a micro USB port 76 and related USB PHY 74 and micro SD port 78. Other interface connections may include SPI, SDIO, PCI, USB, etc. for providing a serial link to a user's PC or other device. SIM/RUIM card 80 provides the interface to a user's SIM or RUIM card for storing user data such as address book entries, user identification, etc.

Portable power is provided by the battery 72 coupled to power management circuitry 70. External power is provided via USB power or an AC/DC adapter connected to the power management circuitry that is operative to manage the charging and discharging of the battery. In addition to a battery and AC/DC external power source, additional optional power sources each with its own power limitations, include: a speaker phone, DC/DC power source, and any bus powered power source (e.g., USB device in bus powered mode).

Operating system software executed by the processor 62 is preferably stored in persistent storage (i.e. ROM 68), or flash memory 66, but may be stored in other types of memory devices. In addition, system software, specific device applications, or parts thereof, may be temporarily loaded into volatile storage 64, such as random access memory (RAM). Communications signals received by the mobile device may also be stored in the RAM.

The processor 62, in addition to its operating system functions, enables execution of software applications on the device 60. A predetermined set of applications that control basic device operations, such as data and voice communications, may be installed during manufacture. Additional applications (or apps) may be downloaded from the Internet and installed in memory for execution on the processor. Alternatively, software may be downloaded via any other suitable protocol, such as SDIO, USB, network server, etc.

Other components of the mobile device include an accelerometer 114 for detecting motion and orientation of the device, gyroscope 115 for measuring or maintaining orientation, magnetometer 116 for detecting the earth's magnetic field, FM radio 118 and antenna 120, Bluetooth radio 98 and antenna 100, Wi-Fi radio 94 including antenna 96 and GPS 90 and antenna 92.

In accordance with the invention, the mobile device 60 is adapted to implement the distance measurement and image processing mechanism as hardware, software or as a combination of hardware and software. In one embodiment, implemented as a software task, the program code operative to implement the distance measurement and image processing mechanism is executed as one or more tasks running on processor 62 and either (1) stored in one or more memories 64, 66, 68 or (2) stored in local memory within the processor 62 itself

Measurement of Distances Related to a Target Object and Related Image Processing System

A block diagram illustrating an example room in which an end user obtains a digital image of sample window is shown in FIG. 3. The distance measurement mechanism enables the automatic measurement of dimensions for a window part from a digital image of the window that includes a reference object in substantially the same plane as the constraint dimension associated with the window. The end user 131 takes a photograph, using a digital image acquisition device such as digital camera 133, which includes a window 130 and the reference object 132. Knowledge of the reference object dimensions is used to calculate any dimensions needed for fabrication of one or more parts for fenestration. The image processing calculations may be performed on the digital image acquisition device such as a smartphone or tablet with built-in camera, on an end user's PC, an external website or any other computing device after the image is uploaded to it.

Also shown in FIG. 3 are one or more ancillary objects placed on the window. Ancillary objects 136 and 138 are typically placed on the window sash or frame and function to aid in demarcating points for measurement. Another ancillary object 134 is placed at the top of the window and function to aid in determining the location of the top edges of the window when a window treatment (e.g., blind) is installed on the window.

A block diagram illustrating an example network showing the data flow between fabricator, designer, service provider and end user is shown in FIG. 4. The network, generally referenced 140, comprises an end user 162, PC or other computing device 150 connected to the Internet or other wide area network 148, fabricator 142, designer 144 and service provider 146. End users may also be connected, for example, via smartphone 158 running an appropriate application (i.e. app) or a tablet device 160 running an appropriate app. Both the smartphone and tablet are connected to the internet via cellular base stations 156 and the cellular network 154. Note that the tablet and smartphone may be connected to the Internet through Wi-Fi to an access point that is connected to the Internet.

End users communicate with the fabricator, designer and service provider via the Internet and connect via any number of devices such as a tablet (e.g., iPad device, Android device, Surface, Nexus, etc.) connected via Wi-Fi or through a cellular connection, desktop/laptop (via wired or wireless connection) computer, mobile device such as a smartphone or cellular enabled wireless tablet both in communication with the fabricator, designer and service provider via cellular network (e.g., 3G, 4G, etc.) including base stations.

The fenestration measurement and image processing mechanism provides the capability of accurately measuring and determining the dimensions of one or more parts from a digital image. The system is intended for use on any computer system such as desktop computers, laptop computers, notebook computers, netbook computers, ultrabook computers, wireless mobile devices, mobile phones, tablets, iOS devices, Android devices, Firefox OS devices, etc. It is however, especially applicable for use on tablets and mobile devices such as the Apple iPad, Android based tablets such as Google Nexus, Microsoft Windows tablets such as the Surface and other tablet formats or smartphones such as the Apple iPhone, Android based smartphones or Windows based smartphones.

Throughout this document the term “website” is used to refer to a user-accessible network site that implements the basic World Wide Web standards for the coding and transmission of hypertext documents. These standards currently include HTML (the hypertext markup language) and HTTP (the hypertext transfer protocol). Note that the term “site” is not intended to imply a single geographic location as a website or other network site can, for example, include multiple geographically distributed computer systems that are appropriately linked together.

It is to be understood that elements not specifically shown or described herein may take various forms well known to those skilled in the art. Figures provided herein are given to show overall function, operation, and relationships and are not drawn with the intention of showing components or elements to scale. It is also to be understood that while the figures and descriptions provided relate to windows and modifications to windows, the method of the present invention may be used in the design, fabrication or specification of any objects meant to work with, within or to replace a target object having one dimension that is substantially smaller than the other two dimensions or having a substantially planar face.

Various terms are used in the art to describe aspects of fenestration and windows in particular. In describing the present invention, the term “window” may refer to a single frame, one or more frames within a complex or an entire complex frame. A “complex” frame refers to multiple windowpanes within the same frame. In describing the present invention, the terms “interior” and “exterior” are used to describe the indoor side and outdoor side, respectively, relative to a perimeter wall in which the fenestration resides. “Inward” and “outward” facing refers to frame surfaces perpendicular to the perimeter wall plane facing toward or away from, respectively, the center of the fenestration.

The term “overlay” is defined as designed to cover an interior or exterior side of a windowpane using as support surfaces such as sash, interior facing trim casing or wall surfaces and includes surfaces that may reside between a screen and windowpane of, for example, casement or awning windows. The term “in-frame” is defined as designed to cover an interior or exterior side of a windowpane using for support surfaces of, for example, jambs or jamb liners, sash channels, stops or inward facing surfaces of trim casing.

The terms “supplemental part” or “supplemental element” are defined as an article that is designed for use with a target object. Non-limiting examples of supplemental parts may include window treatments, films, overlays or inserts that enhance the aesthetics, light control, or heat transfer of windows, or may also include paint, wallpaper, cabinets, shelving, frames or furniture.

The term “sealing interface” is used to describe a visible portion of a window, that may be reversibly opened and closed, at which reversible substantial sealing occurs, when viewed from either the interior or exterior.

The terms “automated”, “semi-automated” and “manual” are used to describe different degrees of human intervention in a process by an end-user, professional or service provider. “Manual” refers to a process performed entirely by a human; “automated” refers to a process performed entirely by computational or other electronic devices; and “semi-automated” refers to a process involving computational or other electronic devices with human intervention at a point in the process.

Note that various people or entities may perform different aspects of the present invention. An “end-user” refers to a person or entity or their designee, that specifies, orders, installs or uses the supplemental parts of the present invention and may perform digital image capture, supply metadata and/or confirmation of design steps of the process of the present invention. A “service provider” refers to a person or entity performing a service that is part of the method of the present invention such as reviewing and accepting or confirming orders from an end-user, providing image processing capability, designing (as a “designer”), fabricating (as a “fabricator”) or installing (as an “installer”) parts, or providing support for installation of such parts.

Other aspects of the present invention relate to dimensions of objects to be measured or imaged. A “target object” of the present invention refers to an object having a constraint dimension that is measured by one or more methods of the present invention. In describing the present invention, “constraint dimension” refers to a measured portion or a multiple of a measured portion of a target object to which a designed part is to conform and a “constraint pixel dimension” refers to the length of a constraint dimension measured in pixels. Similarly, “reference dimension” refers to a reference object dimension whose bounds are detectable in a captured digital image and a “reference pixel dimension” refers to a reference dimension measured in pixels. A target object may contain a “symmetry element” which in the present invention refers to an aspect of the target object that in standard practice resides at a position within the target object such that the symmetry element divides a constraint dimension in an integer number of equal parts. An “ancillary object” of the present invention refers to an object that is used to identify the location of a target object feature of interest in the scene to be imaged.

Embodiments of the present invention contemplate improved method and apparatus for decreasing heat transport through fenestration in which the method of obtaining measurements for custom manufacturing of the insulation and its support is done through photogrammetry using digital images and digital image processing. Other embodiments of the present invention contemplate improved methods and apparatus for supporting, storing and re-using the insulating materials. While the description primarily discusses embodiments related to windows as target objects, other embodiments may include other planar target objects such as a wall, ceiling, floor, furniture or portions thereof, artistic painting, poster, photograph, appliance, or any other object where it is desired to estimate a constraint distance or dimension.

Target Object Measurement Digital Image Processing

One aspect of supplemental window elements that is critical is the attainment of accurate measurement fenestration attributes for proper matching of the supplemental window element to the fenestration. Necessary measurements may include physical dimensions such as width, height and depth as well as color. Such measurements, however, can be time consuming and difficult to achieve for those users not accustomed to such work or if the installation site is difficult to access. Depending on the approach, a significant amount of material may be wasted, either from mismatch of delivered product and the area to be covered or from errors made by end users having insufficient fabrication and installation experience. Further, the presence of objects such as furniture or existing window treatments may complicate attainment of requisite measurements. In addition, depending on the type of window, frame and window treatment, supplemental windows may be difficult or impossible to properly install for optimal thermal and radiative insulation.

While prime windows (e.g., single and multiple pane windows generally usable on a stand-alone basis in fixed buildings, mobile homes, travel trailers and other habitations) are sufficient for structural integrity and habitation security, they are often found to be an insufficient thermal and radiation barrier. To conserve the energy necessary for heating and/or cooling a building supplemental windows are employed in addition to the prime windows. Such supplemental windows have included exterior and interior “storm” windows mounted over the prime windows with a “dead air” space therebetween.

Supplemental windows are structurally and functionally distinct from prime windows. Supplemental windows are primarily intended to protect the prime window and reduce thermal losses therethrough. In many instances, supplemental windows are intended to be installed by the building owner and/or relatively inexperienced workers. As a result, supplemental windows are preferably lightweight, uncomplicated and inexpensive. To avoid detracting from the appearance of either the building in general or the prime window itself and to fit within often tight pre-existing spatial constraints, supplemental windows have tended to have minimal framework, the visible bulk of the window assembly being the window panes. Also, “weep holes” or passageways from the environment to the dead air space are usually provided to avoid condensation build up between the exterior storm window and the prime window. Thus, an optimal thermal barrier between the windows is not achieved.

Interior storm windows can be installed regardless of building height and legal restrictions on exterior building appearance, but suffer other disadvantages. Such windows are generally mounted within the window opening or on the interior building wall outside of the window opening. In such cases these windows are preferably constructed with frames from plastic material, such as vinyl, to reduce thermal conductivity, weight, and expense. These materials, however, have been found to sag and warp in response to the weight and thermal stresses particularly in large windows subject to extended periods of direct sunlight. This sagging is destructive of the structural and air seal integrity of the window unit and can increase the difficulty of raising or lowering the window panes. Further, in tall windows vinyl material has been found to lack sufficient rigidity to maintain close air seals between the sides of the window pane and the receiving channels. Moreover, in those instances where such windows are installed within the window opening, custom sizing and installation are typically needed for each window opening, especially when retrofitting such storm windows to older buildings.

In one embodiment, a customer who wishes to have custom windows or supplemental materials must provide the vendor with window dimensions. Alternatively, an estimator/installer obtains the dimensions. These dimensions are manually input by a skilled operator into a computer aided design device (commonly referred to as a CAD) which creates an electronic image which in turn is input to a plotter/cutter. The plotter/cutter generates the sheet of film cut to the custom specifications. The film is then applied to the window by the customer or installer. Alternatively, the customer or estimator/installer may input the dimensions into an input device and directly receive the cut film without utilizing the services of a skilled operator through a service such as www.computercut.com. Such a service provides the cut film order created at a location remote from the source of the film and then sent (by mail, courier, etc.) to the requestor at the remote location.

Note that using other methods other window related custom products such as window treatments or coverings are efficiently delivered. Window coverings are sold in standard sizes by department stores, discount stores and home centers. They are also sold by custom fabricators who come to the home or office, measure the windows and make blinds to fit. Some retailers sell custom blinds based upon measurements provided by the customer. These retailers keep a limited inventory of stock blinds in standard sizes and popular colors. If the customer does not want a blind from the retailer's current inventory, the retailer may custom order the blind from the manufacturer using the customer's measurements.

Stock blinds have a standard width and length and come in a limited number of colors and materials. In a stock blind, lift cords and tilt controls, if any, are in the same location on every blind. In a custom blind, the blind is made to have a length and width that corresponds to the size of the window opening. The customer specifies whether the lift cords and tilt control are to be on the left side or right side of the blind to avoid nearby secondary objects. The customer can often obtain a custom blind in colors not available in stock blinds. Other options may be available to the buyer of a custom blind that are not available in a standard or stock blind.

The alternative window coverings (“AWC”) industry provides soft and hard window treatments to customers desiring window coverings other than conventional draperies. Hard window treatments include faux wood and wood horizontal blinds, vinyl and metal horizontal blinds, vertical blinds and interior shutters. Soft window treatments include cellular shades, pleated shades, roller shades, soft shades, vertical blinds and soft window shadings. AWC products are offered to customers through a variety of retail channels, including home product centers, independent retailers, discount department stores, retail fabricators, department stores, catalogs, internet, home builders and interior designers and decorators. Typically, custom-made products are manufactured by a wholesale fabricator or a retail fabricator and then are sold either directly to customers or to a retail source that, in turn, sells the completed product to the customer.

A customer desiring a custom-made window covering typically places an order with a retail source, specifying the features of the finished product desired. Such features can include information about the size of the window, the style, the desired color and various additional options including the type of hardware to be included for mounting and controlling the window covering after installation. The retail source passes the order along to the fabricator. Upon receiving the order, the fabricator cuts the pre-colored bulk material into the size specified by the customer and adds the desired hardware to produce the custom window covering. The completed product is then sold directly to the customer and/or shipped to the retail source.

This fabrication technique has disadvantages for the fabricator. Notable drawbacks include wasted inventory due to the generation of scrap material in the manufacturing process and obsolescence of inventory due to changes in manufacturer color lines. The cost of this wasted inventory is typically absorbed by the fabricator and is typically passed along to the end user or customer.

A diagram illustrating a sample window and reference dimensions are shown in FIG. 5. The window, generally referenced 170, comprises the wall 172, frame casing 174, top and bottom sash window 176 with muntins, is shown with a reference object 178 on the lower sash and three ancillary objects, one ancillary object 179 is on the upper sash while two other ancillary objects 175, 177 are placed at sealing interfaces at the left side and bottom, respectively, of the lower sash.

A diagram illustrating the volume of space an image acquisition device must be in when acquiring the digital image of the window is shown in FIG. 6. Since the proficiency of end-users capturing the digital images may be highly variable, there are a number of aspects of the image capture that are preferred in order to keep measurement error to a minimum. It is preferable for the camera (image acquisition device) 454 to be substantially within the orthogonal projection 452 of the target object 450 (e.g., window) toward the image acquisition device, in this case substantially within the cuboid volume extending from the window opening into the room in which the window exists, so that the imaging plane is nearly parallel to the plane in which the target object window/fenestration resides. It is also most preferred that the image acquisition device be positioned at or very near the center of the orthogonal projection of the target object toward the image acquisition device.

It has been found that images captured outward from the constraint projection, in this case the window trim casing, can lead to distortions that are difficult to correct without leaving distortion in the reference and/or constraint dimensions or may render a constraint edge hidden in the captured image. To aid with this positioning for image capture, it can be helpful to capture the image with minimal or no backlighting so as to make reflection of the person capturing the image readily visible to this person when within the projection of the window opening. Further, it is more preferred that the camera reside close to the projection of the window/fenestration center. The capture of images with the camera near the fenestration center also aids in embodiments of the present invention where vanishing point methods are employed to calculate supplemental part dimensions. When employing vanishing point methods, lines perpendicular to the plane of the fenestration such as those associated with the sill, stool, check rail top edges of the lower sash of a vertically operable sash, and inward facing stop edges can be used. Additionally, for reasons discussed below, it is preferred to use an image capture device that allows for minimization of camera motion during exposure. The image capture device may comprise a still camera, video camera, sequence of still images taken in rapid fire fashion, smartphone camera, etc.

Since windows are generally transparent and rectangular in shape they offer the opportunity for further automation of distance measurement. By capturing the digital image under conditions of either predominantly front lighting or predominantly back lighting of the window, high contrast portions of the image are easily obtained and identified. Front-lit images with minimal or low levels of back lighting (for example, taken at night) can be advantageous for choosing custom supplemental part color with respect to the wall, frame and or existing window treatment, easier identification of details in frame molding that may affect mounting, and minimizing shadows that could adversely impact choice of measurement points if minimal image processing is used. In addition, having a dark background eliminates the potential for irrelevant rectangular shapes to be present in captured digital images thus simplifying the process of identifying relevant features, such as a reference object, a frame or sash element or muntin. Thus, capturing the image at nighttime with room lighting or with flash illumination, the transparent portion of the window will appear very dark with respect to a light colored window sash. Such lighting conditions also allow the person capturing the image to adjust the camera position within the frame projection by observing the location of the camera reflection. Alternatively, a capture device with capability of capturing both visible and infrared images may be used. In such a case, capturing the images at a time when there is a significant temperature differential between the exterior and interior sides of the window may allow regions of interest, such as pane edge locations or sealing interfaces to be found in the infrared image. Using the spatial relationship of the visible and infrared images, the regions of interest may be found and used in the image processing of the visible image.

An alternative method of the present invention provides reference dimension measurement using a reference object, optionally having another use when not used in the present invention, or may be a standard size reference object. Prior to capturing the digital image, the end user may place a standard sized object on the window frame, sill, stool, sash, windowpane, next to the window or within the window frame being photographed, as shown in FIG. 3. Standard sized objects should have an easily identified linear dimension that is viewable in the image. More than one standard sized object may be used in an image. Non-limiting examples of such standard sized objects include an open tape measure, a ruler or meter stick, a piece of printing paper or lined paper having known standard dimensions, e.g., letter, legal, A4, A5, etc., a CD jewel case, currency, credit or debit card or government issued documents such as a driver's license or passport. When using an object similar in color or that does not provide sufficient contrast with its surrounding elements it is preferred to have a high contrast border at the peripheral edges or high contrast lines that terminate at the its edge. The reference object may also be a thin electronic display device such as a tablet or laptop computer display or a cell phone display for which the make and model is known and conveyed to the service provider as metadata. Such a display may be altered to provide high contrast and/or color distinction from the surrounding primary and secondary objects to aid in finding and dimensioning such a reference object. Alternatively, a standard object or figure provided by the service provider may be used, printed or displayed electronically whereby the service provider predetermines the dimensions of the standard object or printed figure. When a standard object is provided by the service provider, such standard object is preferably planar and rigid or semi-rigid and may optionally have printed on it a standard figure.

In one embodiment, a standard object or figure may have an uncommon color defining the standard length so that the end user may capture a digital image of the standard object or figure that will subsequently be used as the reference object in the present invention. Using the same capture device and colored standard object and providing their identity to the service provider in the present invention can then aid in automated locating of the reference object in one or more digital images used in the present invention. Additionally, the end user may create a reference object by measuring a non-standard sized object's dimensions and supplying the reference dimensions to the service provider as metadata. Similarly, color information may be calibrated by providing the end user with a standard color sample that can be used to calibrate colors in the image. Examples of objects predetermined by the service provider include pre-printed paper, plastic sheet, picture frame, clip board, cork board or bulletin board sent to or otherwise obtained or purchased by the user and digital files that may be printed by the user near the point of use. When the user prints digital files provided by the service provider, the digital file may be printed on a standard size sheet of paper such that the sheet of paper acts as the reference object and the printed file provides means for identifying the sheet of paper. In such cases, digital files preferably comprise at least one fiducial pattern, such as a checkerboard, dot, or hourglass pattern, or a bar code or QR code.

Fiducial patterns may perform one or more functions in the present invention, such as enabling automated object or feature finding, automated orientation of objects and the image, containing user and/or order information, or enabling relative sizing of different parallel planes. For encoding user and/or order information the fiducial may comprise a code such as a bar code or QR code, the information of which may optionally be encrypted by the service provider, printed large enough for resolving in an image sent from the end user to the service provider. For the relative sizing function, it is particularly helpful to print fiducial patterns having the same pixel dimensions and orientation in the digital file with the same printer settings on the same printer. Such printed digital file preferably contains orientation information such that, when mounted properly by the user, leads to orientation information in the captured image. In addition, the fiducial pattern is printed large enough for the pattern to be found and interpreted by computer vision software.

In one embodiment, checkerboard and hourglass patterns (shown in FIG. 5) of at least about one inch squares have been found to be useful. In the case of QR codes, so that reading of the code at or above about 10 pixels per inch in the image, the pattern should be at least about two inches by two inches in size for a 13×13 pattern, and preferably about six inches by six inches for a 29×29 pattern. Preferably, reference objects should be rigid or can be made rigid during the image capture. For example, if a piece of printing paper is used, at least two, preferably three, adjacent corners should be taped to a flat surface with the entire edge between the adjacent corners in contact with the flat surface. Alternatively, standard sized printing paper may be attached to the window pane, muntins or sash using small amounts of liquid, gel, paste, creme or grease applied to the non-printed side of the printing paper, preferably near the edges of the paper so as to keep the paper as flat as possible. Liquids useful for this purpose do not permanently adhere and are easily cleaned off of the window pane, muntin or sash to which they contact and may otherwise be easily found by the user in their home or workplace. Such liquids include water, although preferred liquids have higher viscosity than water such as dishwashing liquid, liquid soap, hair shampoo or conditioner, hand lotions, oils (for example, vegetable based oils). Preferred gels, pastes, cremes and greases include petroleum jelly, lip balm or gloss, toothpaste or ointment.

When attaching printing paper to muntins that protrude toward the room interior from the window pane, it is preferred to have at least four attachment points. To minimize curling of the printing paper, such as typical 8.5×11 inch multipurpose 24 lb. white paper, after the fiducial pattern has been printed, printing methods that minimize or eliminate water contact with the printing paper, such as toner based printing, are preferred. Use of standard size heavier weight paper or card stock is also beneficial for minimizing curling. When printing with methods that can lead to curling of the paper, such as inkjet printing, it can be beneficial to decrease the amount of printed material used to print the fiducial pattern, while maintaining detectability by the image processing algorithm. This may be accomplished by employing, for example, halftoning to adjust the amount of material deposited on the paper to achieve the desired balance between sheet flatness and detectability of the printed pattern. While bi-tonal black-and-white patterns have been successfully used in the present invention, halftoned patterns may be used in the present invention. Gray levels in the 50% to 75% range have been found to provide improved sheet flatness of reference and ancillary objects while providing sufficient density for algorithmic detection of fiducial patterns under many lighting conditions. Higher gray levels, such as about 80% to 100% (black) improve detectability by the methods of the present invention, particularly for the ancillary objects that may be partially hidden or covered by a shadow.

When using a reference object, it is preferred to place the plane of the reference dimensions of the reference object as close as possible and parallel to the plane of the measured constraint. Therefore, reference objects that are thin in the dimension parallel to the constraint plane are preferred. If the reference object is placed outside the fenestration, for example on the wall immediately next to the fenestration, as described below, the fiducial pattern on the reference object may be used to aid in locating regions of interest and the reference object edges, particularly if there is low contrast between the reference object and the wall. In addition, entropy methods may beneficially be used to aid in differentiating the reference object from the adjacent wall, or when there is low contrast with the window features or windowpane background, adjacent to the reference object in the image in the region of interest, so that reference object edges may be found more easily.

If the reference dimensions are not placed in the same plane as the constraint dimensions, size correction may be performed to account for the perspective error induced by such placement. One method of performing such correction is to print the fiducial patterns using the same printer with the same print settings and having fiducials that are digitally the same size as the pattern printed on the standard size printing paper. The fiducial on the standard size printing paper may be calibrated to the known dimensions of the paper. Placing a second (ancillary) fiducial in a second plane parallel to the window allows dimensions in the second plane to be correctly measured. Preferably, such reference objects are placed near window dimensions of similar length to be determined.

The captured and processed images should have a resolution of greater than one megapixel, preferably greater than two megapixels, more preferably greater than three megapixels and most preferably greater than four megapixels. At the same time, to facilitate edge and corner identification and decreased camera motion errors, reference pixel dimensions must be of sufficient length relative to the image pixel dimensions. Through extensive experimentation capturing digital images using imaging devices of different resolution, reference objects of different dimensions, and different image plane to fenestration plane distances, it has been found that the reference object and its dimensions must be carefully chosen and placed so that symmetrical elements and constraint elements may be readily observed.

If a target object window already has an associated window treatment that will be used with the custom supplemental parts, the image is preferably captured with the treatment opened allowing constraint surfaces and lines to be visible. If the open treatment still covers a portion of the window or frame, additional images of the covered portions may be captured to obtain constraint surfaces or lines hidden in other image views. Any additional image should also contain a reference object so that accurate calculations may be obtained.

In some cases it may be desirable to capture only a single image but the image may have omitted a portion of a relevant constraint, such as a corner or edge. In other cases, a window treatment may be in a fixed position covering at least one of the constraint surfaces or lines. In such cases, symmetry within the window and/or framing or digital extension of the observable constraints may be used to calculate a dimension for which a portion of one constraint is not visible in the image. Symmetry elements such as check rails or muntins may be used to estimate the location of completely hidden constraints. Alternatively, one or more ancillary objects may be created to provide a means for determining the location of a hidden constraint. For example, a fiducial pattern provided by the service provider may be printed on a piece of standard sized printing paper, in which the ancillary object comprises a fiducial pattern and at least one of the intact standard dimensions of the printing paper. For example, one edge of the 11 inch dimension of an 8.5×11 inch piece of printing paper upon which a fiducial is printed may be aligned with the edge of a window pane that is partially obstructed by, for example, a window treatment. When so aligned, the edge opposite the aligned edge may be visible while the aligned edge is obstructed. The fiducial pattern may be used to locate this ancillary object whose standard length is known. The intact dimension from the visible edge to the aligned edge is a standard dimension which, along with knowledge of the pixels per inch for the plane in which this ancillary object resides, allows the hidden constraint location to be determined.

In cases where a window treatment is moveable and covers different portions of constraint surfaces or lines when in different positions, it can be beneficial to capture more than one image of the same window such that different treatment positions are captured. The end user may select and adjust treatment positions to be captured such that the images provide complementary views of constraints. Software programs may be employed to merge two or more images creating a single image offering a clear view of the all desired constraint surfaces or lines in a single image. For example, vertical or horizontal blinds may allow image capture with partial view of a constraint rectangle when raised or pulled to the sides of a window. One constraint surface, however, may be partially or entirely hidden with the blind in such a position. To complement this image, the blind may be in its fully closed position with the blinds rotated to allow imaging of a constraint surface that is hidden in the first image. This single image, having the non-stationary treatment portions removed, may then be used as the basis for further image processing described below.

A preferred embodiment is now described. In this description, several terms are used with the following definitions. A triage resolution image is an image with a resolution suitable for scene content analysis; for example, an image with a width of 960 pixels and height of 640 pixels will provide a resolution of 8 pixels per inch for an image filling object that is 120 inches wide and 80 inches tall in a plane parallel to the image plane and will provide higher resolution for closer objects. A measurement resolution image is an image with a resolution suitable for target object measurement; for example, an image with resolution of 12 pixels per inch at the target object distance.

A measureable image is an image in which rectangular objects in the world appear rectangular in an image; for example, an image of a rectangular object directly in front of a camera where the axis of the lens is perpendicular to the rectangular object. A projective transformation is a mapping from points in one coordinate system to points in another coordinate system which preserves collinearity; for example, a pinhole camera photograph of a planar object on the image plane of the camera. A projectivity matrix is a matrix which is used to encapsulate the calculations needed to perform a projective transformation; for example a 3×3 matrix that is used to convert locations (u, v) in one plane to locations (x, y) in another plane by adding a third coordinate of 1 to a source point (u,v,1) and computing three coordinates (hx, hy, h) by matrix-vector multiplication from which the coordinates of the destination point (x, y) are computed by division.

Image coordinates are the location of a point of interest in a digital image, typically given in pixel offset units from a defined origin point such as the upper left corner of the image; for example, if an image has 960 columns and 720 rows of pixels, the offset of the image center from the upper left corner of the image is 479.5 columns and 359.5 rows. Camera coordinates are an extension of image coordinates to three dimensions by adding distance from the image plane as a third coordinate. Plane coordinates are the location of a point of interest on a planar object in physical units from a defined origin point. For example, a planar object being photographed may have its coordinates defined as offsets from the point of intersection of the camera axis with the plane with distances measured in centimeters or inches. World coordinates are an extension of plane coordinates to the location of a three dimensional point of interest relative to a plane wherein the first two coordinates are the coordinates of the point on the plane closest to the point of interest and distance to the plane is the third coordinate.

For example, if a plane coordinate system has its axes defined using two adjacent sides of a rectangular object such as a window pane, a pane-relative world coordinate system could be defined in a way that positive third coordinates refer to points outside the window and negative refer to points inside. Translation changes in coordinates due to shifting a coordinate system origin point without changing the orientation or units of the coordinate axes. Scaling changes in coordinates due to a change in units on one or more coordinate axes without shifting or reorienting the coordinate axes; equal scaling of all dimensions is called an isotropic scaling; an isotropic scaling preserves the aspect ratio of rectangular objects. Rotation changes in coordinates due to changing the orientation of a set of coordinate axes without shifting or changing units of the coordinate axes.

A capture mapping is a projective transform that maps points in a plane or world coordinate system onto points in an image. An inverse mapping is a projective transform which maps points in an image plane or camera coordinate system onto points in a plane or world coordinate system.

Flow diagrams illustrating an example overall workflow between the end user and service provider are shown in FIGS. 7A and 7B. Following instructions provided by the service provider after accessing the service provide website or mobile app (step 180), the end user prints digital files of fiducial patterns (provided by the service provider (step 204)) on standard printing paper (step 182). The end user supplies metadata such as the particular type of window and the product desired (step 184). For example, the end user may answer questions to supply metadata or the metadata may be the result of using a trial and error digital application such as “The Window Shopper”, available from www.blinds.com, that aids the end user in choosing a window related product with the desired mounting location. Such mounting location may then be input to the instructions provided and used in the present invention.

The user places on the window pane or protruding muntins a reference object of standard printing paper, such as 8.5×11 inch, on which a fiducial pattern is printed (step 186). In addition, the end user optionally places ancillary objects, of standard or non-standard size on which fiducial patterns are printed, on window components as instructed by the service provider, consistent with metadata provided by the end user. The ancillary object fiducial patterns are distinct from the reference object fiducial pattern. Preferably, multiple ancillary fiducial objects may be printed on a single standard size sheet of printing paper and separated by cutting or tearing along lines pre-determined by the service provider.

After constructing the scene of the window by moving obstructing objects and placing reference and ancillary objects in the scene, the end user captures the digital image from a point within the projection of the window as described above in connection with FIG. 6 (step 188).

The captured image is resized to a triage resolution, for example so that the smaller dimension of the image has 720 pixels or 720P, and either sent to a remote server for automated image processing or automated image processing may take place on the capture device (step 190). While the downsized image is being processed, transmission of a high resolution version of the image, which may be the full resolution of the imager, to the service provider server may commence (step 196) and, if transmission is completed the high resolution image may be stored (step 198). The service provider analyses the triage resolution image and provides feedback to the user and determines whether a high resolution image is needed (step 206). If recapture is required (step 192), the method returns to step 186 and user adjusts the scene construction, for example by moving objects in the scene or changing the capture device position, and recaptures the adjusted scene. If recapture is not required (step 192) but the pixels per unit length is not sufficient (step 194), based on the analysis performed by the service provider (step 206), the high resolution image is sent to the service provider for analysis (step 196). The service provider performs measurement resolution image processing and analysis and determines an estimate of the product cost (step 208). The measurement image is stored (step 210).

Once the pixels per inch obtained from the image is sufficient (step 194), the image is stored (step 198) and the user is asked whether the process is to be repeated for additional windows (step 200). If there is an additional window is to be processed, the method returns to step 184. Otherwise, the user places the order (step 202) and the service provider provides dimensions for the product and forwards the order with the dimensions to the designer and/or fabricator (step 212).

A determination of whether the entire high resolution image is sent and/or analyzed may be made based on analysis of reference object pixels per inch of the triage resolution image as described below.

Flow diagrams illustrating an example triage resolution imaging method are shown in FIGS. 8A and 8B. The image processing of the downsized image may result in different feedback to the user. If image processing of the downsized image finds that all necessary criteria are met, the user may be automatically notified that (1) product ordering may be performed, optionally along with a cost estimate, (2) that the image may be stored for future use, or (3) that another window may be imaged. If the image processing of the downsized image finds that at least one criterion is not met by the image, the user is notified that the scene must be imaged again. Further, depending upon the criterion or criteria that were not met, the user may be automatically notified of suggested changes to the scene or its capture that would rectify the problem. Such suggestions are described in more detail infra.

The automatic triage resolution image processing flow shown in FIGS. 8A and 8B is for images containing objects upon which fiducial patterns have been printed by the end user following instructions provided by the service provider. Prior to this automated image processing, the end user may have provided metadata (step 220) regarding, for example the window type and the product that the end user is interested in potentially purchasing, and the end user will be provided instructions on the choice and placement of reference and ancillary printed objects.

After capturing the image with an image capture device having communication capability, the image is downsized, preferably keeping all color information, and along with the metadata input to the image processing software. Since the service provider knows the fiducial pattern provided on the reference object, a complex pattern finding algorithm, for example template matching using a matching metric such as normalized cross correlation or normalized cosine coefficient, or similar method suited to the pattern may be used to find the reference object (step 222). This may be accomplished using template matching software. An example suitable for use with the present invention is the matchTemplate function available from Open Source Computer Vision (OpenCV, www.opencv.org), which is an open source computer vision repository.

Alternatively, the user may obtain a close-up image of the reference object with fiducial and use software that may utilize resizing, rotating, projecting, use of Gaussian or Laplacian multiscale cascade two-dimensional Haar wavelet responses, integral images or other manipulations, such as those used in the art, as in scale-invariant feature transform or speeded up robust features object detection software.

If the reference object orientation fiducial is not detected (step 224) then feedback is provided to the user (step 256) to correct the scene and recapture the image. If the reference object orientation fiducial is detected (step 224), the reference object orientation is detected (step 228) and if correction is required (step 230), the image orientation is corrected using a reference object fiducial (step 258) that has, for example, an n×m chessboard pattern of light and dark squares, where n>m and one of n and m is odd and the other is even. The n×m pattern orientation may be determined by examining the coordinates of the (n−1)×(m−1) inner corners using the OpenCV function findChessboardCorners. Note that in this embodiment, n is assumed to be odd and m is assumed to be even (alternatively, m may be odd and n even).

This orientation is ambiguous, but the ambiguity may be resolved by examining the upper left 2×2 orientation, which may be determined using the OpenCV function matchTemplate to distinguish between two possible vertical or horizontal cases. Alternatively, orientation may be determined using a (1) training classifier, (2) user supplied metadata, (3) accelerometer metadata or (4) through end user confirmation of orientation. The software then compares the fiducial orientation within the image to the proper orientation according to object placement instructions based on window type metadata.

If there is an orientation mismatch (step 230), the mismatch is used to obtain a “gravity down” image by flipping vertical and horizontal to correct an upside down mismatch (step 258), by transposing and flipping vertical if 90 degrees clockwise from correct, or transposing and flipping horizontal if 90 degrees counterclockwise from correct. In each case of orientation detection and correction, optionally the image size may be reduced prior to detection or correction. If the reference object fiducial is not found in the image (step 224), automatic feedback to the user may be provided suggesting that correct placement of the reference object on the window and properly focused imagery be confirmed (step 256).

Once the image orientation is corrected (step 258) or if correction is not required, the edges of the reference object are then found (step 232). Once found, the reference object dimensions are measured (step 234) and if the reference object is acceptable (step 236), the one or more ancillary objects are found using a template match function (step 240). If the reference object is found not to be acceptable (step 236), this is flagged for use feedback (step 238) and the method continues with step 240. If the ancillary objects are found to be acceptable (step 242), the software then attempts to locate the window pane (step 246). If the ancillary objects are found not to be acceptable (step 242), this is flagged for use feedback (step 244) and the method continues with step 246. If the window pane was successfully found (step 248), a perspective transform to be applied to the image is then determined (step 252). If the window pane was not successfully found (step 248), this is flagged for use feedback (step 250) and the method continues with step 252. The perspective transform is then applied to the image (step 254) and any feedback previously flagged is provided to the user (step 256).

A flow diagram illustrating an example method for determining reference object dimensions is shown in FIG. 9. This method is used to determine the reference object pixel dimensions and calibration factors (pixel scale factor, or pixels per unit length). The reference object is found by determining the fiducial pattern characteristics, such as printed pattern type (e.g., chessboard or dots, hourglasses), features, size and nominal location relative to paper edges based on the digital file that was sent to the user (step 260). For example, using a 7×4 chessboard fiducial pattern, the feature grid is found using a method such as the OpenCV function findChessboardCorners (step 262). The local coordinate axes are then defined (step 264) and regions of interest (ROIs) are selected for reference object edge lines (step 266).

Once the object is located, the edges are located using the relationship between locations of points of the fiducial pattern in the image and the nominal locations of those points on the page in the digital file. First, the slope and length of the horizontal line along the top row of the 6×3 set of internal corners is found. This is done by taking the list of 18 approximate corner locations, identifying the top row, defining regions of interest containing the upper left and upper right 2×2 chessboard patterns, locating their centers more accurately by using template matching, template correlation or other complex pattern finding algorithm with one color record (e.g., green) and subpixel offset of the best match relative to each center to determine the top left and top right center locations (step 268). The slope of the line connecting these points is calculated from the vertical and horizontal offsets between the points and a preliminary pixels per inch value (i.e. pixel scale factor) is calculated using the ratio of the measured distance in pixels and the nominal distance between the points in inches (step 270). The calculated slope is used to determine a local rotation of the reference object and local coordinate axes.

The edges of the reference object are found by finding the center of a ‘t’ using the midpoint between the top row corners, placing the crossbar at the desired vertical position and adjusting the center for small tilt. The centers of the four edge regions of interest (ROIs) along the lines of the ‘t’ are located using the approximate pixels per inch and slope value from the T cross point. An edge map is created by matching or correlating corresponding edge finding templates within the regions of interest. The extreme points along the edge map are used to determine the edge line which should be nearly perpendicular to the intersecting ‘t’ line for acceptable edge finding and measurement. Points of intersection of the lines of the ‘t’ and the edges are determined. The distance (in pixels) between the left and right (H_(ref)) and the top and bottom (V_(ref)) of the reference object are based on the line intersection points. These are used to calculate the pixels per inch in each of the horizontal (C_(h)) and vertical (C_(v)) directions using Equations 1 and 2, respectively, where H_(refphys) and V_(refphys) are the reference object physical dimensions in the horizontal and vertical directions, respectively.

C _(h) =H _(ref) /H _(refphys)  (1)

C _(v) V _(ref) N _(refphys)  (2)

An approximate reference object bounding box is calculated which is adjusted for tilt using the calculated pixels per inch and the adjusted box is wrapped around the reference object (step 272). Once the reference object is found, a contour surrounding or adjacent to the reference object may be confirmed to be a pane or contain part of a pane. The reference object location may also be used to mask the reference object, for example between finding a threshold and applying the threshold to the image.

After finding the reference object, ancillary objects are found. A flow diagram illustrating a method for finding an ancillary object is shown in FIG. 10. One or more ancillary objects on which fiducials, distinguishable from that on the reference object, are printed are also found using template matching, template correlation or other complex pattern finding or object detection algorithms. To find the ancillary object(s) with fiducial pattern(s) having a pattern such as hourglass, chessboard, or hexagonal or octagonal design of alternating light and dark triangles using template matching, a corresponding template is created (step 280) and used to generate a search image wherein extreme value(s) of the cosine coefficient normed metric correspond to fiducial locations (step 282). The extreme values are then used to determine a threshold (step 284) that can be applied to the search image to mask out weak signals arising from scene content and produce an image wherein blobs of points surrounding the local extremal values remain, where blobs, as is known in the art, are connected collections of pixels sharing a common characteristic, such as in this case, having a metric value above a threshold (step 286). At least one blob detector is created (step 288) with the desired properties of minimum blob area and separation for finding these locations (step 289).

A flow diagram illustrating a method for finding a collection of ancillary objects is shown in FIG. 11. This method is used to find a collection of ancillary objects. The number and location of ancillary objects may vary such that various steps of this illustrative method are optional and may be included depending on the particular implementation of the invention. To find the ancillary objects, regions of interest (ROIs) are first created above, below, to the right and to the left of the reference object (step 290). A bottom ancillary object is then found by applying the ancillary object finding method (FIG. 10) to the ROI below the reference object (step 292). A top ancillary object is then found by applying the ancillary object finding method (FIG. 10) to the ROI above the reference object (step 294). Any side ancillary object is then found by applying the ancillary object finding method (FIG. 10) to ROIs on either side of the reference object (step 296). A frame casing ancillary object fiducial is then found using the side ROIs (step 298). When the frame casing ancillary object fiducial is found, the subpixel fiducial center is then located and an object bounding box is created for each fiducial found (step 299). Any of these ancillary objects are acceptable if their geometric properties are within specified ranges relative to the location, size, and/or orientation of the reference object.

In addition, the ancillary object and/or the reference object may have printed a pattern that enables detection of poor focus or camera movement at the time of capture using modulation or edge strength measurements, such as a Siemens Star. If camera movement is detected by finding directional blurring, suggestions for inhibiting movement in a re-capture of the scene may be provided. If poor focus is detected by finding general blurring, the software may suggest ways to inhibit movement during capture, making sure the camera finds focus before capturing and if focus problems repeat may suggest using a different capture device.

In a preferred method, the user will have been instructed to place the ancillary objects in regions relative to the reference object and the dark pane and the ancillary object's fiducial pattern may be, for example, an hourglass or chessboard distinguishable by array size from that on the reference object. The image is searched by template matching or correlating the corresponding template over the region(s) of interest to create a search image. For example, two ancillary objects on which hourglass shaped fiducials are printed may be placed horizontally below and vertically to one side of the reference object. Such ancillary objects may have an edge that is highly contrasting to the sash and frame to allow the contrasting edge to be easily found for subsequent measurement of sealing interface locations or inward facing edge locations.

Other useful ancillary object locations include at the frame casing edge in region of interest to the side of the reference object and/or with one or more edge abutting the top of a pane for cases where a non-movable obstruction, such as a window treatment, may be present. Such ancillary objects will each contain multiple fiducials along its length. Those that are visible below the obstruction are located and may be used to calculate the position of the obstructed edge using the relationships between the most widely separated fiducial patterns on the object in pixels and their known separation on the object to define a scale, finding the visible lower edge using a light/dark template and template matching, and using the scale and known object dimension to estimate the location of the obstructed edge at the top. Alternatively, because such objects have been aligned with the top edge of the pane, the bottom edges or equivalently the bottom fiducials may be used to define a line near and parallel to the top of the pane for subsequent analysis and used to aid the pane finding and perspective transform determination methods described below.

If there is a mismatch between the number and/or location of ancillary objects found by the automated method and the user metadata expected number and location of ancillary objects, a message may be sent to the user with suggestions for re-capturing the scene so that the ancillary objects in the scene match the metadata. When found, the subpixel fiducial centers on each ancillary object are found and an ancillary object bounding box is determined using the relationship between these centers in the image and the nominal dimensions of the object. One use of an ancillary object is to aid in the location of an obstructed pane edge, such as the top edge of a pane covered by a window treatment as described below.

A flow diagram illustrating a method for finding window panes is shown in FIG. 12. As described above, the captured image may optionally be resized to triage resolution (step 300). A bilateral filter may be used to denoise the image (step 302) and the image is made grayscale (step 304). The dark parts of the image are found by performing binary thresholding (step 306). Such thresholding may be performed by applying one or more of Huang, minimum, intermodes, fixed threshold, adaptive local threshold such as OpenCV adaptiveThreshold, or using variable or dynamic thresholding by first calculating the gradient and searching in the subsection of image pixels. The binarized image resulting from thresholding will contain one or more connected components corresponding to dark portions of the scene.

The edge of each component may be traced to provide a closed contour that contains the component using, for example, the findContours function of OpenCV (step 308). Dark portions identified in this way are examined to remove those that are too near an image edge, too small or too large relative to the image area, too narrow in its aspect ratio, or too irregular in shape. A dark portion is deemed to be sufficiently regular in shape (“sufficiently rectangular”) if the locations of its edges are tightly enough distributed, ignoring small protuberances and invaginations as well as ignoring areas known to contain reference or ancillary objects. For example a histogram of the left, right, top and bottom locations of a contour can be computed and the ratio of the areas of rectangles with vertical and horizontal edges passing through the 25^(th) percentile (outer box) and inner 75^(th) percentile (inner box) can be compared using an upper bound threshold to measure the departure from an ideal value of one attained by a non-rotated rectangle.

In the case where the problem of non-rectangularity is along the top, the portions of the contour that are above the line determined by the top ancillary object may be replaced by points along the line. Those contours are judged to be sufficiently rectangular (step 310). The sufficiently rectangular pieces form a collection around which a bounding box is found for the dark pane area (step 312). If sufficiently rectangular dark portions of the image are not found, an alternate thresholding method may be tried, and if no alternate succeeds, feedback may be provided to the user that the scene should be imaged when the pane background is dark or that objects may be obstructing the pane that should be removed from their obstructing positions.

In some instances, reflections, features of the sash holding the windowpane or features to the exterior of the window pane (e.g., storm windows) may lead to more than one detected image edge near the actual windowpane edge in the image. In such cases, it may be helpful to identify these edges and send to the user, service provider or designer an image defining choices for such edges. After human viewing of the image with defined edge choices, the user, service provider or designer may provide input with the best edge choice for the windowpane. For example, preferably after applying the perspective transform described below, thresholding may be performed as described above.

Template matching, using a black/white template, may be applied in the pane edge region to generate a template matching criterion curve that contains peaks for high value matches to the template. Such peaks correspond to edges that may correspond to the actual pane edge in the image. For each peak of the template matching criterion curve, a line having a unique characteristic to each peak (e.g., color, dash, etc.) may be respectively drawn on the image. Each line may be made visible to the user, service provider or designer properly aligned with a pane edge in the image thus allowing choice of the correct pane edge by the person viewing the image. The person viewing this image may then provide their choice for the correct pane edges as metadata to the service provider and the choice may be used in subsequent steps of the image processing.

Flow diagrams illustrating a method for determining a perspective transform are shown in FIGS. 13A and 13B. The bounding box of the window pane is first located (step 320). Regions of interest are then defined along the top, right, left and bottom edges of the bounding box around the dark pane area (step 322). For cases in which the true top edge of the pane is obscured and the top edge is defined synthetically (step 324) as described above, processing of the top region of interest is not performed and the synthetic top line is used instead of processing the top region of interest to obtain an edge line as described below. Edge images of the regions of interest are then created using an edge detector, such as a Canny edge detector (step 326). The parameters used for the Canny edge detector may be obtained by serially obtaining edge images with different parameters and examining them for suitability. The reference object fiducial may be used to provide image by image tuning of the Canny parameters and the parameters may be different for the high and low resolution images of the same scene. Edges corresponding to reference or ancillary objects may be removed from the edge image.

A probabilistic Hough transform locates edges of interest and a consensus edge is created from the edges of interest along each of the four sides of the bounding box (step 328). The consensus edges are generated from the edges of interest (step 330). The intersection points of the consensus edges are used as the source points for determination of the perspective transform using a method such as that used in OpenCV getPerspectiveTransform (step 332). The destination points for the perspective transform are the corners of the tightest rectangle having vertical and horizontal sides that encompasses all of the source points or preferably a rectangle with vertical and horizontal sides passing though the midpoints of the consensus edges (step 334), as shown in FIG. 14 where dashed box 352 represents the corner constraint box and dotted box 354 represents the midpoint constraint box drawn around the image 350 (solid box). The perspective transform based on either of these sets of destination points may not preserve the aspect ratio of objects in the scene, nor will the overall size of objects or the location of the center of the image be preserved. It is desirable to modify the 3 by 3 perspectivity matrix representation of the transform to accomplish these ends. First the triage image is transformed using a method such as that used in OpenCV warpPerspective to obtain a perspective corrected triage image. It is preferred to map destination pixels to source pixels to avoid artifacts. Interpolation may be performed by resampling using pixel area relation. These properties are available in the OpenCV warpPerspective function.

The reference object is then relocated in the perspective corrected triage image, and measured to determine the pixels per unit length values as described in the discussion of FIG. 9 above (step 336). In the case these values are not identical, the first row of the perspectivity matrix may be multiplied by the ratio of the pixels per unit length in the vertical and horizontal directions to balance the rows in a way that aspect ratios would be preserved (step 338). Once the rows are balanced, the overall scaling of the transformation may be determined using methods described in detail below wherein relationships between a two-dimensional perspectivity matrix and a related three-dimensional perspectivity matrix are discussed. In that discussion, a method by which an overall scaling parameter s may be determined is described. The homogeneous coordinate h_(c) of the image center is determined by multiplying the third row of the perspectivity transform and the coordinates of the image center. The first two rows of the balanced perspectivity transform are then multiplied by h_(c) and divided by this value of s to normalize the transform so that the overall scaling parameter is 1 (step 340).

Finally, a shift in the location of the image center is determined by applying the balanced and normalized perspectivity matrix to the location of the image center in the triage image to obtain its position in an image that would be obtained using that matrix using a function such as OpenCV perspectiveTransform. This shift is used to adjust the translation vector located in the first two rows of the third column of the perspectivity matrix by subtraction so that the location of the image center is preserved (step 342). This balanced, normalized and center preserving transform becomes the final triage image perspective transform. The determined transform parameters may be used to automatically decide whether the scene should be re-captured and guidance provided to the user to move closer to the projection of the window center for the re-capture of the scene using methods described in detail below. After the transform is determined, repeated correction of the perspective distortion in the triage resolution image is optional. As described below, the triage image perspective transform may be used to transform higher resolution images prior to steps needed for measurements.

A flow diagram illustrating an example preparation for measurement method is shown in FIG. 15. The method of measuring target objects in the scene is shown in FIG. 16. With reference first to the method of FIG. 15, to prepare for the measurement the triage image is uploaded (step 360) and analyzed as described in FIGS. 8A and 8B (step 362). This analysis provides a measured value for the pixels per unit length in the plane of the reference object. This triage value should be chosen to be at least 10 pixels per inch, preferably at least 15 pixels per inch, more preferably at least 30 pixels per inch. If the chosen triage value is exceeded by the measured value (step 364) in the analysis of the triage image, transmission of the high resolution image may be aborted and the triage image may become the Provisional Measurement Image (376) after applying the perspective transform to the triage image (step 366). If the triage value is not exceeded (step 364), the higher resolution image transmission is completed (step 368).

The high resolution image orientation is determined and, if necessary corrected (step 370). The first perspective transform determined, for example as shown in FIGS. 8A and 8B, for the triage image is rescaled (step 372), for example by using a matrix similarity transform to adjust for scale difference, and applied to the high resolution image (step 374) to form the Provisional Measurement Image (step 376). Such Provisional Measurement Image has vertical and horizontal features in the scene that are substantially, although not necessarily exactly, vertical and horizontal in the image. Of particular importance, removal of the bulk of perspective distortion results in more accurate measurements of the reference object.

One embodiment for image processing workflow may be completed as shown in FIG. 16. This workflow employs results from the triage resolution analysis, including, for example, object (reference object, ancillary object and window pane) locations, the perspective transform and metadata (step 380). It is important to note that even after all perspective distortion is removed from the scene, the reference and ancillary objects may still be rotated relative to the window due to manual placement variability and may contain some aspect ratio distortion after the perspective correction is applied. The transform can also be applied to coordinates of the locations of objects in the scene from the triage resolution analysis to aid in determining smaller regions of interest for efficient location of these objects in the provisional measurement resolution image, for example, to find reference and ancillary objects and window panes.

Using location information from the triage resolution image analysis and following the method described for the triage resolution image workflow, the reference object is found and its dimensions measured (step 382). Similarly, the ancillary objects and windowpane are found using location information from the triage resolution image analysis and the methods described for that analysis (step 382). When the pane edge locations are found in the image using the same light/dark template matching method as used to determine the edges lines of the reference object (step 384), the slopes of these edge lines defined in such a way that the vertical lines have zero slope along the sides and horizontal lines have zero slope along the top and bottom are also recorded.

These slopes are then tested to determine if the transformed image of the pane is rectangular and aligned to the image axes (step 386). If the slopes are all the same to within a determined tolerance (step 388), the pane is determined to be rectangular. If the slopes are all zero to within a second determined tolerance, the pane is determined to be aligned. If both of these conditions are met, an improved transform is not needed, resulting in enhanced performance by avoiding the need to compute and apply a second transform and relocate the objects and pane (step 390). This is typically the case in many images.

If either of the above conditions is not met for the first time (step 400), a final transformation may be determined using the edge locations and slopes to directly define source and destination points analogously to the method used to determine the transform in the low resolution workflow (step 404). This transform may then be applied to the first transformed provisional measurement resolution image to obtain a final transformed image, the measurement image, and recomputing the object and pane finding steps. The rectangularity and alignment tests may be reevaluated and, although it is possible to repeat the loop upon failure, typically at most a single final correction is required. Therefore, the potential failure is noted for review and the method continues as if it had succeeded (step 402). When the measurement image is ready, it may be downsized and stored if desired.

For ancillary objects described above, the outward high contrast edge lines associated with them are found and their locations determined to allow locating target objects or features of interest with respect to the nearest parallel pane edge (step 392). These locations may be found using template matching or correlating with a template that is dark in one half and light in the other with template orientations chosen according to the edge direction and darkness/lightness pattern of interest. Locations of these features may be determined using techniques such as dark/light template edge matching or correlating. Windows may include additional features of interest such as muntins or grids, check rails, or mullions that are easily locatable in the scene given pane edge and ancillary object locations (step 394). While the above method provides for a full automation of measurement, the measurement image may also be provided to the end user and/or designer, optionally with identification of ancillary object edges of interest, so that the target object edge locations can be confirmed or adjusted by the end user or designer.

Using the pixels per unit length calculated when finding the reference object in the measurement image, the pane dimensions for the pane on which the reference object resides may be directly calculated from the pane pixel dimensions in the measurement image (step 396). Such dimensions may be used to directly specify a pane related product or may be combined with other measurements to specify other products that may relate to sealing interfaces, inward facing frame dimensions or frame casing related products including pane related and other such products as described in more detail in co-pending U.S. patent application Ser. No. 14/315,503, to Wexler et al., entitled “Supplemental Window For Fenestration”, filed Jun. 26, 2014, incorporated herein by reference in its entirety.

A flow diagram illustrating an example method for calculating a target object dimension substantially in the same plane as the reference object is shown in FIG. 17. When the user metadata indicates that a product relating to, for example, sealing interfaces or inward facing frame surfaces is desired, the dimensions of the window pane on which the reference object resides is calculated (step 410) as described above. The pixel distance from the side ancillary object outer vertical edge that identifies the sealing interface or inward facing frame surface location to the nearest vertical pane parallel edge is determined (step 412). The pixel distance determined in step 412 may be converted to a physical distance using the horizontal pixels per inch to obtain the horizontal distance from the pane edge to either the sealing interface or inward facing surface (step 414). Such a distance may be useful in specifying auxiliary parts as described in U.S. patent application Ser. No. 14/315,503. The pixel distance determined in step 412 is then multiplied by two (taking advantage of symmetry) and added to the pane horizontal pixel dimension, the sum of which is converted to a horizontal physical dimension using the horizontal pixels per inch calculated when finding the reference object for the measurement image (step 416). Similarly for the vertical dimension, the pixel distance from the bottom ancillary object outer horizontal edge to the bottom pane edge is determined, multiplied by two and added to the pane vertical pixel dimension found for the measurement image. This is converted to a physical dimension using the vertical pixels per inch calculated when finding the reference object for the measurement image.

A flow diagram illustrating an example method for calculating the target object dimension offset from the reference object plane is shown in FIG. 18. For dimensions that are not substantially in the same plane as the reference object, fiducial size differences relative to the reference object (step 420) may be used to make adjustments needed to account for out-of-plane scale distortions induced by the use of the pane plane projection transform and may be used to calculate corrected pixels per inch for the plane of interest to allow for more accurate measurement of such dimensions. These out of plane distortions include both magnification, with objects in closer planes appearing larger and further planes appearing smaller, and translation, with objects shifting their position according to their distance from the camera location in their plane as shown in FIG. 19, using methods based on geometric scene reconstruction described below.

The relative pixels per unit length (i.e. plane offset scaling factor) for a fiducial in an arbitrary plane and the reference object on the pane in the transformed measurement image (step 422) together with geometric scene reconstruction also allows estimation of the distance between the planes, for example the distance between the planes containing each pane of a vertical or horizontal sliding window (step 424). These methods may be used, for example, to locate edges of a window's frame casing when a fiducial is used to identify the outward-most frame casing edge (step 426). The symmetric horizontal offset of the outer frame casing on each side of the pane is used to calculate the outer frame casing horizontal dimension using the measurement image pane dimension and scaling factor (step 428). These methods may also be used to locate points on a single or double hung window top sash on which a fiducial containing ancillary object has been placed, to correct the locations of various points in the top sash pane plane. Symmetry and/or machine learning may be used as an alternative to this approach for the vertical sliding window top (exterior) sash when the reference object is placed on the bottom (interior) sash. With product specification calculated, a corresponding product cost may be determined and provided to the end user, for example in a digital shopping cart. In addition, the dimensions of the specified product may be provided to a product designer and/or fabricator.

It should be noted that a camera calibration model that allows correction of other distortions due to lens design and sensor to lens alignment may be obtained by analysis of several images of a sufficiently complex pattern that covers a sufficiently large portion of the image. Such models are typically incorporated into the camera software to obtain distortion free images and are trivially added as a preprocessing step if a camera is discovered to have such distortions. In the description below, it is assumed that such a camera calibration model has been applied to obtain the original image into which a reference object has been placed. In the above described methods the perspective transform derived using coordinates of pane corners to establish source and destination points does not in general preserve aspect ratios of physical objects in the plane of the pane. These distortions require the use of two separate scaling factors for converting vertical and horizontal displacements in pixels into physical units. A preferred method, in which the transform does preserve aspect ratio and which has other advantages, will now be described.

The substantially planar reference object comprising a pattern having four or more locatable points with nominal positions and recognizable using image analysis methods described above, such as chessboard corner finding, dot grid center finding, QR barcode finding or similar pattern finding is placed in the scene and found as described above. The pattern on the reference object contains information sufficient to determine general image orientation and a combination of transposition, vertical flip or horizontal flip operations may be used to correct the orientation as described above.

The locatable points are measured and the measured locations and nominal locations are used to derive a nominal printed pattern mapping in the form of a 3×3 projectivity matrix, also known as a perspective transform. This derivation may be performed using, for example, the method used in OpenCV getPerspectiveTransform for four points or findHomography for four or more points. Such a mapping defines a relationship between nominal points in the plane of the reference object and points in the image. When image locations are used as source points and nominal locations are used as destination points, the derived nominal inverse mapping would be from image point locations to nominal point locations. Such a transformation is invertible to form a nominal capture mapping and together with the nominal inverse mapping allows mapping points between the nominal reference object plane and the image in either direction. A capture mapping can be found by switching the roles of source and destination in the routine used to derive the transform.

A nominal scaling between image distance units in pixels and nominal distance units is easily obtained by applying the nominal capture mapping to a pair of nominal points that are one unit apart and computing the distance between the points in image pixel units. Such a pixel per distance scale factor can be applied to the nominal capture and inverse mappings by scaling the top two rows of the inverse projectivity matrix by the scaling factor and scaling the top two rows of the capture projectivity matrix by the inverse of the scaling factor to obtain projectivity matrices that may be used to apply to digital images represented by code values at pixel coordinates to obtain resulting digital images using digital imaging software such as OpenCV using its warpPerspective function without dramatic changes in overall resolution.

The reference object edges are then located in the image as follows. A scaled nominal inverse mapping may be applied to an entire image, for example using OpenCV warpPerspective, to obtain a nominal image in which the reference object pattern matches the nominal geometry in pixel scaled units. If the physical pattern locations match the nominal pattern locations exactly on the reference object and the mapping is exact, the edge locations in the nominal image are completely determined. When such a pattern is printed on paper, the printed pattern may be mispositioned on the page relative to its nominal geometry by scaling in one or both directions as well as translation on the page due to printer driver settings and further misplacement plus rotation within the plane due to paper to printer transport biases. Such misplacements are typically small, but lead to an uncertainty in the locations of the actual edges of the reference object in the image relative to the printed pattern.

In addition, the transformation itself is subject to errors due to measurement errors in the locations of the points used to define it. Therefore the edges of the printed pattern need to be located more precisely in order to define a relationship between physical locations of points in the plane of the reference object and points in the image. This may be accomplished by establishing locations in the nominal plane which contain the edges with a high degree of certainty, using the nominal capture mapping transform to determine approximate locations of these edges in the image, surrounding these image locations with sufficient additional height and width to create regions of interest in which an edge detection method may be applied, and then applying the edge detection method to define lines which match the location of the edges in original image coordinates.

Preferably, the scaled nominal inverse transform is applied to the image or a portion of the image which contains the aforementioned regions of interest to create an image in which the edges are substantially vertical and horizontal and create regions of interest along each edge which contain the edge with a high degree of certainty and allow for use of an edge detection method to define lines which match the location of the edges in the scaled nominal image coordinate system. Regardless of the coordinate system in which the edges are located, the appropriate inverse or capture transform may be used to locate them in the other as needed.

The physical transforms may now be determined. Once the edge lines are located, a relationship may be developed which characterizes the relationship between nominal and physical locations of printed patterns on a reference object as well as a relationship between original image and physical locations. Four edge line locations may be used to infer locations of the corners of a rectangular reference object in the corresponding original image or nominal image coordinate systems. These may be used along with the physical dimensions of the reference object to define a perspective transform. If the edge lines are defined in the nominal printed pattern coordinate system, a Nominal to Physical model is obtained. This transform may be composed with the Image to Nominal transform to obtain an Image to Physical transform. Alternately, if the edge lines are defined in the original image coordinate system, an Image to Physical model is obtained. This model may be composed with the inverse of the Image to Nominal transform to obtain a Nominal to Physical transform. Again, to avoid drastic changes in resolution when applying a transform to images to produce an image, the Image to Physical transform is preferably scaled to produce results in pixel units.

The Image to Physical transform allows transformation of the original image into an image in which distances within the plane of the reference object that are measured in pixel units are directly proportional to physical distances by a pixel per physical unit ratio. Additionally, the aspect ratio of rectangular objects in this coordinate system is preserved for a rectangular object in any plane parallel to the plane of the reference object. The Nominal to Physical transform can be derived in matching units to allow transformation of other printed patterns into physical coordinates, enabling establishment of their physical size from nominal sizes, a feature useful in establishing sizes of other printed objects when they do not include known physical dimensions, such as printed patterns that are cut out of a page using cutters, scissors, or even fold and tear methods.

The image may now be transformed into physical coordinates. In this step, we apply the resolution preserving scaled image to physical inverse transform to the image. Preferably, this is achieved by inverse interpolation using the transform to determine the location in the original image corresponding to a location in the physical image and interpolating into the original image using these coordinates. This may be accomplished, for example, using the warpPerspective function of OpenCV.

Other objects placed in the scene may be located as described above. In those methods, the nominal dimensions of the patterns in the object design are used to aid in locating and measuring the patterns while analyzing images. These nominal dimensions may be converted to physical dimensions using the Nominal to Physical transform to obtain dimensions appropriate for use with an image in scaled physical units.

When the reference object is placed in the scene in a way that it is substantially parallel to the plane of the windowpane, it may be rotated relative to the natural windowpane coordinate system which we refer to as the world coordinate system. Location of a single edge of the pane in the physical image allows determination of this rotation and the rotational aspect of the physical transform in the upper two rows of the transform could be modified to obtain a final by multiplying by a rotation matrix that results in the pane edge being vertical or horizontal as desired. As all four edges are to be located in any case, the average rotation of the edges may be used along with the spread of the rotations to determine whether the only remaining effect is this rotation or whether there is some residual distortion that requires a further perspective correction. This correction will result in a very modest apparent aspect ratio distortion in the reference object as well as a very modest change in the scale factor derived from a unit physical vector that may be corrected by scaling corresponding rows in the perspectivity matrix.

In the present invention, there may be instances in which measurement of dimensions in parallel offset planes is desirable. For example, sliding or hung windows have panes in parallel planes that require measurement or the frame casing around a window may be in a different plane than the pane on which the reference object is placed. Also, the wall in which a window is mounted may be in a parallel plane offset from the reference object plane. In addition, there may be custom supplemental products for which complete specification requires a dimension estimate perpendicular to the plane of the window, such as described in U.S. patent application Ser. No. 13/735,449 cited supra.

Using the reference object and ancillary objects, for example as described above, in offset planes, 3D projective geometric modeling together with information regarding the relationship between camera lens focal length and sensor size, typically described using a 35 mm equivalent focal length, may be used to analyze the 2D images obtained in the present invention to provide measurement estimates between and within the offset planes. In addition, such modeling may be useful in determining whether the image was captured from within the interior projection of the window. Although it is technically possible to determine a pose and position of the reference object or pane relative to the camera by analysis of the projectivity matrix, this commonly performed geometric scene reconstruction task may be accomplished directly using routines such as solvePnP provided in OpenCV given the same source and destination data together with camera intrinsic parameter data. The routine provides a rotation vector r and a translation vector T that fully describe the relationship between the set of world and camera coordinate systems. The rotation vector may be converted into an orthonormal rotation matrix R or vice-versa using the OpenCV Rodrigues function, which together with the translation vector may be used to form a set of linear equations, as shown in Equation 3 below.

$\begin{matrix} {\begin{bmatrix} x \\ y \\ z \end{bmatrix} = {\begin{bmatrix} {sR} & {sT} \end{bmatrix}\begin{bmatrix} u \\ v \\ w \\ 1 \end{bmatrix}}} & (3) \end{matrix}$

The camera information required to obtain the translation vector between the camera origin and the world origin includes both the focal length of the camera and the location of the camera axis, referred to as the camera principal point, in the image. One may use the center of the image in pixel units measured from the upper left corner as the principal point and define the focal length of the camera in pixels as well. The ratio of the length of the diagonal of the image in pixels to the focal length of the lens in pixels equals the ratio of the diagonal of a 24×36 mm rectangle to the 35 mm equivalent focal length of the camera. In addition, if these ratio values were known, the distance of the camera to the origin of the world coordinate system could be determined using this ratio and a known diagonal length. Information regarding these ratio values is publicly available from various sites on the internet and could be used to choose a value given camera identification information. A 35 mm equivalent focal length is often incorporated in image EXIF metadata. In cameras used in smartphones, the range of values of 35 mm equivalent focal length is typically within a 28-35 mm range, with many at or near 30 mm, and we have found that use of an approximately 30 mm assumed 35 mm equivalent focal length is effective at providing a camera focal length. When the solvePnP routine is provided these camera parameters together with the source and destination points in the camera image and world coordinates, the resulting rotation and translation information is in the camera coordinate system.

The translation in the world coordinate system may then be determined by multiplying the inverse of the rotation matrix, namely its transpose, times the translation vector and negating the result to obtain the world coordinates of the camera location both within the plane of the window as well as the camera-to-subject distance from that plane. This location may then be compared to the coordinates of the window boundaries to determine if the image was captured from within the orthographic projection of the window. Further, once a camera to subject distance is known, relative magnification of measureable objects in planes parallel to the plane of the reference object may be used to determine their distance offset along the camera axis which may be resolved into components in the world coordinate system, enabling estimation of plane to plane offset in world coordinates as well as their translation in the plane coordinates of the image after the inverse mapping is applied.

When doing projective geometry, a fourth row is added to account for ambiguity of locations of points in the real world along lines through the camera coordinate system origin, resulting in a model using homogeneous coordinates wherein points [x y z 1], [hx by hz h] and so forth are all regarded as identical. The model equation relating coordinates [u v w] and [x y z] is now nonlinear, but can be expressed using a linear set of equations encapsulated into a 3D projectivity matrix followed by rescaling using the fourth coordinate as shown below in Equation 4:

$\begin{matrix} {\begin{bmatrix} {hx} \\ {hy} \\ \begin{matrix} {hz} \\ h \end{matrix} \end{bmatrix} = {\begin{bmatrix} \begin{matrix} {sR} \\ H \end{matrix} & \begin{matrix} {sT} \\ 1 \end{matrix} \end{bmatrix}\begin{bmatrix} u \\ v \\ w \\ 1 \end{bmatrix}}} & (4) \end{matrix}$

The 2D model for the pane plane is obtained by deleting the third column, as w=0, and the third row since we are concerned only with the image plane. A 2D transform that applies to another plane parallel to the plane of the pane is related to the 2D transform for the plane of the pane by changes in the offset T and the scalings s and h that depend on the distance between the planes, the third entry in Hand the third column of R. A general form valid for any w is given by Equation 5 below:

$\begin{matrix} {\begin{bmatrix} {h^{\prime}x} \\ {h^{\prime}y} \\ h^{\prime} \end{bmatrix} = {\begin{bmatrix} {s^{\prime}R_{uv}} & {s^{\prime}T_{xy}^{\prime}} \\ H_{uv}^{\prime} & 1 \end{bmatrix}\begin{bmatrix} u \\ v \\ 1 \end{bmatrix}}} & (5) \end{matrix}$

wherein R_(uv) is the upper left 2×2 block of R and the remaining items are given by Equations 6 through 9 wherein H_(w) is the third element of H, H_(uv) is a 2-vector comprising the first two elements of H, T_(xy) and T′_(xy) are 2-vectors comprising the first two elements of T and T′ respectively, and R_(xy,w) is a 2-vector comprising the first two elements of the third column of R, as follows:

h′=h/(1+wH _(w))  (6)

s′=s/(1+wH _(w))  (7)

H _(uv) ′=H _(uv)/(1+wH _(w))  (8)

T _(xy) ′=T _(xy) +wR _(xy,w)  (9)

If a 2D model is provided that applies for w=0, this process may be substantially reversed to create a full 3D model form in which all but two of the elements of the projectivity matrix are determined. The fact that the upper left 2×2 in the 2D model is a scaled copy of the upper left 2×2 of the 3D model allows determination of the third row and column using properties of a full rotation matrix R. The orthonormal matrix R has the property that the sums of the squares of the elements of the rows are all equal to one and that the sums of products of elements in different rows are all zero. Since we have only two of the three elements in each row of the 2D model and they have been scaled by the same number, we have two unknowns to determine the first two rows of the scaled 3D rotation matrix. We can use the orthonormality of R to generate two equations which determine these values to within a sign. Once these values are chosen, a scale value s can be determined as the root sum square of either row. Finally, a third row is obtained by taking the vector cross product of the first two rows, resulting in a vector with length equal to the square of the scale value, so it may be rescaled by dividing by the scale value s.

The sign ambiguity in the first two elements of the third column results in a paired ambiguity in the first two elements of the third row. The sign ambiguity may be resolved by examination of the location in the original image of the corners of a rectangle surrounding the image center using the 3D model, choosing the sign that results in the appropriate sign of z. The distance increment from the camera, z, is positive in areas where the corners are closer to the center of the original image and negative in areas where the corners are further away from the center. This model may be used for the plane where w=0 without determining the third elements of H and T, but if it is to be applied to another plane wherein w is not zero, the model is not well defined. For purposes of determining a rotation vector however, the rotation matrix R is fully defined, enabling estimation of distances as described above.

A preferred method of using geometric scene reconstruction for determining relative location differences for objects in a plane whose w coordinate is not zero is now described as illustrated in FIG. 19. FIG. 19 shows an orthographic view of a measurement image with a pane aligned to the horizontal u-axis and the vertical v-axis, shown as rectangle 430, an out of plane ancillary object 432 containing fiducials to the left of the pane, the location of the original image center as circle 437 near the center of the measurement image, and the location of the camera as a second circle 439 below and to the left of the center.

Note that although the inside of rectangle 430 is shown as white in FIG. 19, if the photo of the window is taken at night, the interior of rectangle 430 (i.e. the window pane) will be dark and the two small circles will be against a dark background.

FIG. 19 also shows a view of the scene from above (in the v direction) with the plane of the pane shown as a solid horizontal line 434 in the u-axis direction, the planes of the ancillary object shown as horizontal dashed lines 436 and central projection lines from the camera location (open circle 439) to various points of interest in the scene such as the image center location 437, with the vertical line in the w-axis direction. The distance between the planes is indicated along a vertical dashed line placed at the pane edge location. The location of the ancillary edge of interest is shown in the ancillary plane and its location in the measurement image is shown in the pane plane.

The apparent distance from the pane edge to the ancillary edge of interest is magnified and shifted due to the projection, and means to compute the horizontal location of the ancillary edge of interest is now described. The distance between the fiducials in pixels is measured in the measurement image and the pixels per unit length is calculated using knowledge of the physical distance between fiducial centers. The pixels per unit length of the ancillary object thus measured applies throughout the plane. The ratio of this value to the corresponding value obtained from the reference object forms a scale factor s. This scale factor is related using properties of similar triangles to the ratio of distances from the two planes to the camera and to the ratio of distances of the ancillary object from the camera position, as follows:

$\begin{matrix} {s = {\frac{\Delta \; c^{\prime}}{\Delta \; c} = {\frac{{\Delta \; c^{\prime}} + {\Delta \; h} + {\Delta \; p}}{{\Delta \; c} + {\Delta \; p}} = \frac{D^{\prime}}{D^{\prime} + {\Delta \; d}}}}} & (10) \end{matrix}$

In this equation, Δd is negative when the ancillary object is closer to the camera. The amount of offset due to the projection of the offsetting distance normal to the planes Δh is positive when the camera position is inside its location and is negative when the camera position is outside its position as would be expected for a visible or blocked segment respectively. The distance of interest for the measurement of objects in the plane of the ancillary object is Δc, and its value can be computed using the scale factor s and values that can be measured in the measurement image, where Δp is the horizontal distance between the camera location and the pane edge and the sum (Δc′+Δh) is the horizontal distance between the pane edge and the projected ancillary object edge of interest:

$\begin{matrix} {{\Delta \; c} = {\frac{\left( {{\Delta \; c^{\prime}} + {\Delta \; h}} \right)}{s} + {\left( {\frac{1}{s} - 1} \right)\Delta \; p}}} & (11) \end{matrix}$

The distance of interest if a depth measurement is desired is Δd and its signed value can be computed using the scale factor and the distance of the camera from the pane plane:

$\begin{matrix} {{\Delta \; d} = {\left( {\frac{1}{s} - 1} \right)D^{\prime}}} & (12) \end{matrix}$

Note that errors in estimating the location of the camera center due to any differences in the 35 mm equivalent focal length used in geometric scene reconstruction or errors in locating points in the scene which would lead to errors in Δp are multiplied by (1/s−1), which according to Equation 12 is the ratio of Δd to D′, a value that is typically small.

In one embodiment, when using symmetry to aid with calculating measurements, a useful input to the algorithm are the vertical and horizontal positions of the capture device with respect to the window. Such information may be obtained from the image by analysis of the image reflected in the windowpane. For example, the software may pre-set the flash setting to fire at the time of capture creating a bright spot with a roughly circular shape, and characteristic intensity falloff with distance within the dark pane of a frontlit scene. Based on these bright spot characteristics and, optionally, the size of the bright spot, the capture device location may be determined. The bright spot position provides a very close estimate of the camera lens location at the time of capture, particularly when a smartphone is used as the capture device. In this case, the distance Δp needed to properly calculate the location of the ancillary object using Equation 11 does not require locating the camera position in space, but estimates of the depth are not enabled without geometric scene reconstruction using camera 35 mm equivalent focal length as described above.

When two locations in a plane whose w coordinate is not zero are known to be symmetrically placed horizontally with respect to the horizontal pane center, Equation 11 may be employed on both left (L) and right (R) sides of the pane. Furthermore, since the total distance across the pane Δp_(L)+Δp_(R)=p is known and since the objects are symmetrically placed so that their distances Δc_(L) and ≢c_(R) from the pane edges are equal, the following system of four linear equations are obtained relating the various distances:

$\begin{matrix} {{\Delta \; c_{L}} = {\frac{\left( {{\Delta \; c_{L}^{\prime}} + {\Delta \; h_{L}}} \right)}{s} + {\left( {\frac{1}{s} - 1} \right)\Delta \; p_{L}}}} & (13) \\ {{\Delta \; c_{R}} = {\frac{\left( {{\Delta \; c_{R}^{\prime}} + {\Delta \; h_{R}}} \right)}{s} + {\left( {\frac{1}{s} - 1} \right)\Delta \; p_{R}}}} & (14) \\ {p = {{\Delta \; p_{L}} + {\Delta \; p_{R}}}} & (15) \\ {{\Delta \; c_{L}} = {\Delta \; c_{R}}} & (16) \end{matrix}$

This system of equations is easily solved to provide a horizontal camera location relative to the pane edge(s) as well as the distance from the pane edges of the symmetrically placed objects. If a rotation vector is obtained using the capture transform as described above, this horizontal location in the w=0 plane is sufficient to determine the vertical location of the camera in the w=0 plane as well as a camera distance from the w=0 plane without employing knowledge of a 35 mm equivalent focal length. Alternately, if an object in a scene lies in a plane not parallel to the w=0 plane, measured distances in that object may be utilized to determine the w locations of features on that object.

For example, a rectangular object of known dimensions may be placed in a plane in which the vertical location v in world coordinates is constant and is oriented so that two of its sides have constant w coordinates w_(R) (442) and w_(F) (444) and the other two have constant u coordinates u_(L) and u_(R) as shown in FIG. 20. Triangle similarity relations among the lengths of the projections of the front and rear edges indicated by dash-dotted lines 446 and the distances of these edges from the camera location 438 at w=w_(E) given the known dimensions u_(R)−u_(E) and w_(R)−w_(F) permit determination of the camera distance from the w=0 plane (440), again without employing knowledge of a 35 mm focal length. In either of these cases, the distance from the original image center location in the w=0 plane to the camera location in the w=0 plane together with the camera distance from the w=0 plane allow determination of the camera-to-subject distance. This together with the distance across the image along the pivot axis in pixels and the conversion factor between pixel distances and physical distances allow determination of a 35 mm equivalent focal length for the camera which may be used in other scenes not containing symmetry objects or objects with known dimensions placed in planes not parallel to the w=0 plane.

For methods that utilize fiducial patterns or additional objects placed in the scene to aid in finding target objects or locations within an image, it will be appreciated by those skilled in the art that the fiducial patterns may be printed to appear black or any other coloring and the additional objects may be of any coloring that provides sufficient contrast and differentiation relative to the scene of interest. Colored fiducials or objects, especially those having bold, vibrant color, may be helpful to aid with finding objects placed in the scene that are to be used for measurement. Also, use of such colors may be useful when capturing window images when a significant portion of the windowpane has light entering from the outdoors.

A fully automated metadata gathering method may be used in which image analysis automatically generates metadata, for example, window orientation based on the location of a windowsill or window treatment attribute, used in subsequent constraint calculation. Metadata that may be useful in the present invention includes the window orientation, window type (e.g., single or double hung, sliding, casement, fixed, etc.), and location and type of object in the image such as a reference object or window treatment and associated control mechanism. In addition to image related metadata, the end user may provide order information, such as payment and delivery information and preferences, at any time during the process prior to submitting an order. End user preferences may include the type of sheet including material composition, optical properties, the number and location of sheets and whether window or window shade operability is desired. Additionally, metadata or constraint calculation accuracy may be confirmed with the end user as part of the process, optionally using the digital image or annotated version of the digital image.

In another embodiment, software incorporated in the capture device, such as CameraSharp, corrects for camera movement at the time of capture or measures the amount of movement and alerts the end user to capture a new image if the movement is found to be above a predetermined threshold. The predetermined threshold may be varied depending upon the size of the reference object used or the ratio of its size to the size of the image captured. Also, it is preferable to keep the exposure time as small as possible while still capturing sufficient light to identify the reference object and constraints in the image. In one embodiment, the exposure time should is less than 0.125 second. Additionally, to inhibit the impact of end user movement during image capture, it is preferred to minimize or remove delay between the end user shutter actuating movement and the actual shutter actuation or to use voice actuation of the shutter. Such exposures may be enabled using software that overrides any device manufacturer incorporated shutter actuation delay.

The digital image undergoes image processing that provides dimensional information for the fenestration, frame and treatments so that appropriately dimensioned custom supplemental parts may be designed and manufactured for installation at the fenestration site. More specifically, an end user, such as the owner or renter of an indoor space having a window or someone hired by such owner or renter, selects a window in that space for modification to decrease optical transparency or heat flow by conduction and/or emission through the fenestration. The end user obtains a digital image of the selected window. The digital image may be obtained using any type of image capture device such as a mobile device containing an image sensor or in communication with an external image sensor (e.g., a webcam), for example a digital still, including rapid multi-exposure digital still, or video camera, a camera phone or smartphone, a laptop computer, a tablet computer or other mobile device.

After obtaining the digital image, the digital image and associated metadata undergo digital image processing. The digital image processing may occur in one or more locations depending upon computing power and software availability as well as the extent to which automation is used. In one embodiment, the end user sends the digital image and associated metadata to a service provider. As part of the metadata provided by the end user, the end user may click or tap on lines or surfaces or use a crop tool to identify locations on the fenestration image to be used for calculating constraint dimensions. The end user metadata input may be provided using a software application that prompts the end user for specific information that will aid in calculating the constraint dimensions.

When custom supplemental parts for more than one window is desired by the end user, the end user may indicate aspects of all the windows that are to be the same so that the metadata input by the end user may be less cumbersome and redundant images may be omitted. The software application may also include image comparison capability so that similar windows may be automatically suggested or identified. Such image comparison capability may include identifying windows having the nearly identical dimensions, framing, sash in-frame and tilt lock locations, muntin type and location, and sash handle type and location.

In one embodiment, the service provider uses digital image processing algorithms to determine the dimensions of, for example, the window, window frame or window treatments. The dimensions are used to design, either automatically or semi-automatically, custom supplemental parts that will fit to the window and/or frame, taking into consideration operability of the window, any window treatment present and end user preference. The design is then used to custom fabricate at least custom supplemental part and means for supporting such custom supplemental part so that at least a portion of the window may be covered. Alternatively, software may be used by the end user so that image processing and calculations may be performed with the capture device. Image processing and/or calculational software may also be used by the end user, service provider and/or fabricator in conjunction with a computing device, store based kiosk or other computing devices or services such as cloud computing services, or any combination thereof.

In one embodiment, metadata regarding the conditions of the image capture at the time of digital image capture are obtained. If the device used to obtain or capture the digital image provides metadata with the digital image, such metadata is used to minimize end user input of metadata. For example, the present invention can beneficially use standard metadata formats such as those governed by Exif, IPTC, XMP, DCMI or PLUS. Such formats provide information that may be useful for applying image corrections including the capture device make and model, orientation/rotation, compression, resolution, flash use, focal length, aperture value, ISO speed and pixel dimension, shutter speed and lighting.

Additional metadata provided by the end user may be provided at the time of image capture or at another time using another digital device such as a computer, kiosk or website. End user metadata may include specific window information if custom supplemental parts are to be provided for more than one window. For example, a window identifier such as “Joe's Bedroom South Wall” might be used to distinguish from “Joe's Bedroom West Wall”. Such an identifier may remain with the image through manufacturing of the parts associated with a given window so that the identifier may be printed or embossed on each part associated with that window. Also, the end user may wish to specify what type of custom supplemental part is desired. For example, different types of plastic sheets may be used to cover a window, such as transparent, semi-transparent, opaque, tinted or low-e with variations of solar gain. The plastic sheet may have additional functionality such as a flexible solar cell array as is known in the art, for example as described in U.S. Pat. No. 7,675,057 and U.S. Publication No. 2012/0125419.

In addition, the end user may provide a manual measurement to aid in the calculation of other dimensions. Depending upon what type of supplemental part is desired by the end user, different sets of mounting surfaces may be used so the user may specify, on the capture device or other device, which surfaces are to be used for mounting as part of the metadata. Manual measurement may be done using devices such as rulers, tape measures and digital measuring devices such as laser distance measuring tools. When providing manual measurements, the end user may specify the length measured along with pixels in the digital image corresponding to the end points of the length measured. In one embodiment, the user may use an ancillary object feature that demarcates a target object measurement point for an end point of a manual measurement. The manual measurement may be confirmed by image processing and analysis methods described above. If the manual measurement significantly differs from the measurement estimated by image processing and analysis, feedback may be provided to the user to manually re-measure the target object dimension. Alternatively, the measurement estimated by image processing and analysis may be provided to the user prior to manual measurement or its input as metadata by the user.

Further, the end user may provide metadata about reference and/or ancillary object dimensions in each image such as location and numerical value dimensions. Methods for facilitating location metadata input may include zoom capability as is known in the art, which may be exemplified by software such as random access JPEG described in U.S. Pat. Nos. 7,038,701; 7,652,595 and 7,847,711 to allow for location identification using the capture device. Alternatively, the image may be transported to a computer, uploaded to a website or transferred to a kiosk to allow the user to point and click on the reference and/or ancillary objects and enter information about the objects, including physical dimensions or the location of measurement point demarcating features.

The methods described for correcting images of fenestration are particularly useful when used to design custom supplemental parts having means of adjustment or conformable deformation when compressed within the constraint surface dimensions calculated. Deformation means may be incorporated into the custom supplemental parts through the use of continuously deformable means, for example, cantilevers, compressible foam, for example a polymer foam, or tube, or piles. Such conformable compression means may also be used in conjunction with continuous or non-continuous adjustment means such as a snap fit means. The compressible and adjustment means may be used to provide compression fit to more than one depth location of the window frame since there are relatively small differences in the window frame dimensions at different depths within the window frame. Thus, a single set of custom supplemental parts may be used with different constraint surfaces.

In another embodiment of the present invention, measurements from end user provided images may be corrected using lookup tables and camera metadata. The lookup tables may contain camera specific information about distortions (e.g., optical distortions such as lens related distortions) that could lead to measurement errors, including barrel, pincushion or complex distortions. The lookup tables may be based on previous calibration studies for each particular camera.

With image and associated metadata information, relevant constraint surface dimensions are calculated. The calculation of lengths may be done automatically for all possible products and surfaces or may be limited to those selected by the end user/designee provided metadata. Lengths may be automatically calculated based on image information showing consistent continuous surfaces for mounting. Alternatively, a semi-automated method may be used in which such surfaces may be identified from metadata provided by end user/designee or by the service provider with human intervention.

With calculated lengths available from measurement algorithms described supra, custom supplemental parts are then fabricated. Using metadata provided by the end user or designee, appropriate materials are used, cut to size, imprinted with relevant information and packaged. For example, the end user or designee may specify among several options such as overlay or in-frame, adhesive or pressure mounting, location of adhesive mount if chosen, whether window or window blind operability is desired, if multiple sheets are to be used how many and where they are to be mounted. Such metadata may have been provided prior to submission of an order.

Alternatively, the end user or designee may wish to obtain a cost estimate prior to submitting an order. In this case, very rough measurements made prior to any image distortion correction may be used to estimate the materials needed for various supplemental parts so that various options and their associated costs may be provided prior to order submission. With this information, an order may be generated to a centralized fabrication site or multiple distributed fabrication sites. Centralized fabrication entails fabrication of all custom supplemental parts at a single site where the parts may also be assembled for packaging and delivery to the end user. When distributed fabrication is used, each fabricator may fabricate a subset of the parts necessary for full functionality of the delivered product. The subset parts may be sent to an order collation site for packaging and/or assembly of final product parts prior to shipping to the end user. To minimize material waste during fabrication, it may be desirable to compile multiple orders for each subset part to allow for an optimized fabrication run.

It will be appreciated that measurements made by the methods described herein may also be useful for applications that do not lead to fabrication of parts. For example, if the target object in each of a plurality of images is a different wall of the same room, it is possible to obtain the dimensions of a room for real estate, architectural, engineering, or any other purpose. Alternatively, by measuring a dimension of a piece of furniture located remote to a room in which it is desired to place the piece of furniture, it is possible to determine whether the piece of furniture will fit properly within a desired space in the room using the present invention to measure room dimensions. It will also be appreciated that using multiple reference objects residing in different planes and substantially coplanar with target objects that are parallel to the imaging plane may be used to measure multiple target objects that are captured in the same digital image.

The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the singular forms “a”, “an” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms “comprises” and/or “comprising,” when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.

The corresponding structures, materials, acts, and equivalents of all means or step plus function elements in the claims below are intended to include any structure, material, or act for performing the function in combination with other claimed elements as specifically claimed. The description of the present invention has been presented for purposes of illustration and description, but is not intended to be exhaustive or limited to the invention in the form disclosed. As numerous modifications and changes will readily occur to those skilled in the art, it is intended that the invention not be limited to the limited number of embodiments described herein. Accordingly, it will be appreciated that all suitable variations, modifications and equivalents may be resorted to, falling within the spirit and scope of the present invention. The embodiments were chosen and described in order to best explain the principles of the invention and the practical application, and to enable others of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated. 

What is claimed is:
 1. A method of estimating at least one dimension of a target object within a digital image which includes a reference object having a fiducial pattern printed thereon placed substantially in a plane of the target object, the method comprising: obtaining a digital image containing the target object and the reference object; locating the reference object in the digital image utilizing the fiducial pattern; calculating a pixel scale factor based on both measured and known dimensions of the reference object; locating the target object in the digital image; and calculating the at least one dimension of the target object based on the pixel scale factor.
 2. The method according to claim 1, further comprising providing feedback to a user if the reference object fiducial cannot be found in the digital image.
 3. The method according to claim 1, further comprising providing feedback to a user to indicate insufficient contrast between a window pane background and the reference object.
 4. The method according to claim 1, further comprising providing feedback to a user that includes one or more suggestions for scene adjustment to improve detection of the reference object.
 5. The method according to claim 1, further comprising applying a perspective transform to the digital image.
 6. The method according to claim 5, wherein said perspective transform comprises a balanced normalized center-preserving transform.
 7. The method according to claim 1, wherein said target object comprises a window.
 8. The method according to claim 7, further comprising locating window pane edge contours utilizing the location of the reference object.
 9. The method according to claim 7, wherein the digital image includes one or more ancillary objects having a respective measurement point demarcating feature and the at least one dimension is calculated using window pane contour dimensions, one or more ancillary object feature demarcated measurement points relative to the window pane contour dimensions and symmetry of one or more window related elements.
 10. The method according to claim 1, wherein the digital image includes one or more ancillary objects each having a respective measurement point demarcating feature.
 11. A method of estimating at least one dimension of a window within a digital image which includes a reference object having a fiducial pattern printed thereon placed substantially in a plane of the window, the method comprising: obtaining a digital image containing the window and the reference object; applying a perspective transform to the digital image; locating said reference object in the digital image utilizing said fiducial pattern; calculating a pixel scale factor based on both measured and known dimensions of the reference object; locating the window in the digital image; and calculating the at least one dimension of the window based on the pixel scale factor.
 12. The method according to claim 11, wherein end user information is encoded on the reference object.
 13. The method according to claim 11, wherein metadata is encoded on the reference object.
 14. The method according to claim 11, wherein the digital image includes one or more ancillary objects having a respective measurement point demarcating feature and the at least one dimension of the window is calculated using window pane contour dimensions, one or more ancillary object feature demarcated measurement points relative to the window pane contour and symmetry of one or more window related elements.
 15. A method of estimating at least one dimension of a target object within a digital image which includes a reference object having a reference fiducial pattern printed thereon and one or more ancillary objects for aiding in determining the dimensions of the target object and having a respective ancillary fiducial pattern printed thereon, the method comprising: obtaining a digital image containing the target object, reference object and one or more ancillary objects; applying a perspective transform to the digital image; locating the reference object in the digital image utilizing said reference fiducial pattern; calculating a reference pixel scale factor based on both measured and known dimensions of the reference object; locating the one or more ancillary objects in the digital image utilizing said respective ancillary fiducial pattern; locating the target object in the digital image; and calculating the at least one dimension of the target object utilizing the pixel scale factor and the measurement point.
 16. The method according to claim 15, wherein both said reference object and said ancillary object are in the same plane.
 17. The method according to claim 15, wherein said reference object and said ancillary object are in different planes and an ancillary pixel scale factor is calculated based on both measured and known dimensions of the one or more ancillary objects or ancillary fiducial patterns on the one or more ancillary objects.
 18. The method according to claim 15, further comprising determining the distance between the two planes based on said reference pixel scale factor and said ancillary pixel scale factor.
 19. The method according to claim 15, wherein said one or more ancillary objects function to demarcate one or more measurement points.
 20. The method according to claim 15, wherein said one or more ancillary objects function to aid in determining a top edge of said target object in the event a window treatment is present on said target object.
 21. The method according to claim 15, wherein said one or more ancillary objects function to determine a depth offset between planes if the target object consists of more than one plane.
 22. The method according to claim 15, wherein end user information is encoded on the reference or ancillary fiducial patterns.
 23. The method according to claim 15, wherein metadata is encoded on the reference or ancillary fiducial patterns.
 24. The method according to claim 15, further comprising locating window pane edge contours utilizing the location of the reference object.
 25. The method according to claim 15, wherein the at least one dimension of a window is calculated using window pane contour dimensions, one or more fiducial demarcated measurement points relative to the window pane contour and symmetry of one or more window related elements.
 26. The method according to claim 15, further comprising locating the camera position in the digital image and using said position to aid in calculating said at least one dimension.
 27. The method according to claim 15, wherein said perspective transform comprises a balanced normalized center-preserving transform.
 28. A computer program product for estimating at least one dimension of a target object within a digital image which includes a reference object having a fiducial pattern printed thereon placed substantially in a plane of the target object, the computer program product comprising: a non-transitory, tangible computer usable storage medium having computer usable code embodied therewith, the computer usable program code comprising: computer usable code configured for obtaining a digital image containing the target object and the reference object; computer usable code configured for locating the reference object in the digital image utilizing the fiducial pattern; computer usable code configured for calculating a pixel scale factor based on both measured and known dimensions of the reference object; computer usable code configured for locating the target object in the digital image; and computer usable code configured for calculating the at least one dimension of the target object based on the pixel scale factor. 